Score:0

Howto dump loaded valid ssl cert's from running nginx, which was erased from disk by mistake?

ru flag

I knew about gdb. I already dump memory of running nginx process. I see all txt *.conf configs in that dump.

But! howto find, convert, etc... some of memory range from that dump to valid initial and erased ssl cert?

(Now I can not nither reload or restart my nginx - nginx -t WARN me, there is no ssl cert's)

Tim avatar
gp flag
Tim
Might be easier to get a new certificate issued, or restore from backup.
Michael Hampton avatar
cz flag
Yes, just restore from your backup.
dave_thompson_085 avatar
jp flag
PKIX (SSL/TLS) certs are encoded in ASN.1 DER, and contain some components easily searched for like your issuing CA's name. But even easier most CAs let you download your cert(s) again anytime you want, plus most CAs today (must) log issued certs to public transparency logs, which you can easily search to find yours plus any chain cert(s) -- I like https://crt.sh . But the cert is useless without the _privatekey_ which you didn't mention, but is almost always in the same config dir and usually the same file as the cert, and trying to find that in memory will be a lot harder.
jack j avatar
ru flag
Yes. Imean mostly privatekey rather then cert itself.
in flag
Does the cert file stay open while nginx is in use? if so maybe https://serverfault.com/a/238431/187998 could be used.
jack j avatar
ru flag
No. nginx only load configs and other cert's and p.keys when it start or reload. I check by lsof.
jack j avatar
ru flag
And this. My problem already is solved. But, for the future for someone - if anybody leave solution about that case - it will be great! Thanks to all for advises!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.