crypto: cleanup root certificates and skip PEM deserialization · nodejs/node@18ea88b · GitHub
Skip to content

Commit 18ea88b

Browse files
joyeecheungtargos
authored andcommitted
crypto: cleanup root certificates and skip PEM deserialization
- We do not actually need them in PEM format, so just pass them around as X509 direcrtly. - The cached global X509 structures were previously never cleaned up. Clean them up at process teardown. - Use function-local static to ensure thread-safety in initialization. - Add more comments about how the various options differ. PR-URL: #56999 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent c011271 commit 18ea88b

3 files changed

Lines changed: 146 additions & 113 deletions

File tree

src/crypto/crypto_context.cc

Lines changed: 141 additions & 113 deletions

src/crypto/crypto_util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ void InitCryptoOnce();
6262
void InitCrypto(v8::Local<v8::Object> target);
6363

6464
extern void UseExtraCaCerts(std::string_view file);
65+
void CleanupCachedRootCertificates();
6566

6667
int PasswordCallback(char* buf, int size, int rwflag, void* u);
6768
int NoPasswordCallback(char* buf, int size, int rwflag, void* u);

src/node.cc

Lines changed: 4 additions & 0 deletions

0 commit comments

Comments
 (0)