crypto: load system CA certificates off thread · nodejs/node@89fe635 · GitHub
Skip to content

Commit 89fe635

Browse files
joyeecheungtargos
authored andcommitted
crypto: load system CA certificates off thread
When --use-system-ca is enabled, load the system CA certificates eagerly off the main thread to avoid blocking the main thread when the first TLS connection is made. PR-URL: #59550 Refs: #58990 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 40b217a commit 89fe635

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

src/crypto/crypto_context.cc

Lines changed: 21 additions & 0 deletions

src/crypto/crypto_util.h

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

4747
extern void UseExtraCaCerts(std::string_view file);
48+
extern int LoadSystemCACertificatesOffThread();
4849
void CleanupCachedRootCertificates();
4950

5051
int PasswordCallback(char* buf, int size, int rwflag, void* u);

src/node.cc

Lines changed: 14 additions & 0 deletions

0 commit comments

Comments
 (0)