-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
node 17.1 verify failure using https with pfx certificate #40672
Comments
This comment was marked as abuse.
This comment was marked as abuse.
Thank you for the report. Could you post information about the PFX file you are attempting to load, @564064202? For example, using OpenSSL, you can list the contents of the PKCS#12 structure without revealing secret keys. openssl pkcs12 -info -in mycert.pfx -noout This should print a list of objects and algorithms, e.g.,
|
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
@564064202 The error is most likely due to the use of RC2 is disabled by default in Node.js 17 and can only be enabled through the legacy provider, see However, before enabling the legacy provider, you should consider using a different cipher to protect your PKCS#12 files. RC2 is disabled because it is technically broken and because it has virtually no advantage over modern ciphers. |
This comment was marked as abuse.
This comment was marked as abuse.
All releases are listed as GitHub releases in this repository, in the Additional information is sometimes available through the nodejs Twitter account and/or through Node.js medium. In this case, the problem might have been difficult to track down since we did not actively disable RC2. Instead, as part of the transition to Node.js 17, we updated OpenSSL from 1.1 to 3.0, and OpenSSL 3 disabled many legacy algorithms, including RC2. |
Closing this issue as answered. Please let us know if the problem persists after switching to a supported cipher (or enabling the |
For the curious: with OpenSSL 3, you can use a command like
to modernize the cipher on your |
My
|
When you say node migrated from openssl 1.1 to openssl3.0 , Does node include its own copy of openssl , or is it just a wrapper around system openssl. |
Considering the wording in this nodejs.org announcement, it seems that yes, node has its own copy of openssl. |
There is something going on with this version of node and openssl. The application worked perfectly fine on olders node envs , and here i just now tried even disabling https and proxing is not working ( even without https ). Wondering if |
@tniessen , I am getting a mac verify error with Node 18 LTS, even with the following info:
The same cert is working with curl
|
I guess it works with Have you tried chucker command or my commands? |
Change the encrypted algo with PBE-SHA1-3DES solved my problem Here my full command line to generate my pfx file ( -inkey and -certfile options aren't mandatory ) |
Thanks for the example, for me |
I have tried both of these commands but on my machine, openssl reports there's no legacy option:
|
@Quang810 I had the same problem. Solved it by running the commands on ubuntu instead.
|
On mac, '-legacy' is an invalid command. So simply remove it from the first command:
However the second command does nothing to change to encryption (it remains RC2). I used the following command:
This seems to have changed the Edit: Depending on your situation, you might want to use a different cipher, like
I needed this cipher so node 18 would stop complaining and also the service I was making requests to could still correctly receive the pfx files |
Is this error reported because the certificate is not available |
I'd like to point out that the error message could be improved. |
If you need to retain the type of the cert container as p12, you can re-encrypt this way (tested on mac): openssl pkcs12 -nodes -legacy -nokeys -out push_cert.pem -in PATH_TO_LEGACY_P12
openssl pkcs12 -nodes -legacy -nocerts -out push_key.pem -in PATH_TO_LEGACY_P12
openssl pkcs12 -export -in push_cert.pem -inkey push_key.pem -out re_encrypted.p12 |
In regards to the PFX file utilizing older RC2 non-compliant SSL standard along with your certificate be installed locally on a Windows device.. you can use Manager User Certificates MMC to export the certificate with AES256.. cipher to allow for Node v20.. to get passed the unCaughtException error |
Version
17.1
Platform
ubuntun 20 x64
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
every time
What is the expected behavior?
No response
What do you see instead?
pem works fine
Additional information
No response
The text was updated successfully, but these errors were encountered: