-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenSSLv3 - loading certificates is much slower than previous versions #16871
Comments
Just to add that I did also cut down the code above to confirm it was the call to PEM_read_bio_X509 versus anything else. In both Node.js 17 and Node.js 16 there are 131 entries in the array to be read in. |
And to answer one of the questions from the report template. Node.js compiles in openssl. |
This is a known deficiency of the OpenSSL 3.0. Unfortunately the way how the decoding works is much more complicated than in 1.1.1 and there is probably a lot of space for potential optimizations. We would like to tackle this in a future release. |
@t8m thanks for the update. Good to know that it's not something we are doing wrong on our side. |
Any idea how many root_certs are loaded here? |
@slontis the array that is iterated through has 131 entries, but don't know if that matches your question about root_certs? |
Looking back at the code, since the array is called |
I can confirm a hit of about 60 ms, measured on different architectures and CPU sizes, with e.g. the default Ubuntu CA certs, compared to 1.1.1. |
we also see the performance degrade in Amazon Linux 2023 (at least in the .NET runtime).. would be good to know once fixed. |
Recreated on Linux x64 and Windows x64 with Node.js 17 that uses OpenSSL v3
Node.js provides the option to add extra certificates. When this is done the certificates are loaded using
PEM_read_bio_X509
as follows:This seems to be much slower in OpenSSL v3 (which is what was pulled into Node.js 17) versus earlier versions. Loading extra certificates seems to add 60 or more milliseconds (will vary by machine) than it did before. Since startup time is only 40ms on the same machine without extra certificates going from 40 to over 100ms is pretty significant.
Is this a known issue or expected? I searched through github and the release notes but I've not been able to find anything that might explain or suggest this would be expected.
The text was updated successfully, but these errors were encountered: