You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node 17.1 verify failure using https with pfx certificate #40672
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.,
MAC: sha1, Iteration 2048
MAC length: 20, salt length: 8
PKCS7 Encrypted data: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048
Certificate bag
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048
@564064202 The error is most likely due to the use of pbeWithSHA1And40BitRC2-CBC in the PKCS#12 file, in particular, because of RC2.
RC2 is disabled by default in Node.js 17 and can only be enabled through the legacy provider, see --openssl-legacy-provider.
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.
Reacted by Adrian, Eliah Rusin, Kai Lan, Roman Belov, shoxxdj, IBR41Furkan, Marcus Oliveira Costa, deriye, Aron Frostinger, Mihkel Kuusküll and 15 more
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.
Reacted by caok2709, Giovanni Thenstead and Paulo Eli
Closing this issue as answered. Please let us know if the problem persists after switching to a supported cipher (or enabling the --openssl-legacy-provider option if switching to a different cipher is not possible).
Reacted by Tobias Nießen, Valentin, IBR41Furkan, Rodrigo Rodriguez, Fredrik Möllerstrand, Jaakko Juvonen, Eliah Rusin, Andy Edinborough, Alex Vinicius Castro, Ben and 8 more
Reacted by Florian Reinhart, Alexander J. Lallier, trevor-webster, Fredrik Möllerstrand, Hugo Alliaume, nicolas-ulmete, Igor Gonçalves, Berkay Kılıçlı, Eliah Rusin, Don Nguyen and 13 more
Reacted by Jardson Sales, Felipe Oliveira, Ilia Choly, Tim Perry and Arya Adarsha Gautam
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.
I am a spot here because the local system openssl version is LibreSsl 2.8.3 , so i can't seem to run the above commands to upgrade the cipher in .pfx. But at the same time , node is not accepting the deprecated cipher.
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. I am a spot here because the local system openssl version is LibreSsl 2.8.3 , so i can't seem to run the above commands to upgrade the cipher in .pfx. But at the same time , node is not accepting the deprecated cipher.
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. I am a spot here because the local system openssl version is LibreSsl 2.8.3 , so i can't seem to run the above commands to upgrade the cipher in .pfx. But at the same time , node is not accepting the deprecated cipher.
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 ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355: error has something to do with the fact that the system openssl version is different. This could also be an error with http-proxy that vite uses internally, but the also all of this ( including https proxying) was working earlier.
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 ) openssl pkcs12 -certpbe PBE-SHA1-3DES -inkey KEY_FILE.key -in CERT_FILE.crt -certfile PARENT_CERT.crt -export -out PFX_FILE.pfx
Reacted by Rodrigo Rodriguez, Jaakko Juvonen, Dovlat Yakshibayev, ₿itconym, Yaroslav Pavlov, Eric Snover and TT
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 ) openssl pkcs12 -certpbe PBE-SHA1-3DES -inkey KEY_FILE.key -in CERT_FILE.crt -certfile PARENT_CERT.crt -export -out PFX_FILE.pfx
Thanks for the example, for me PBE-SHA1-3DES still didn't work, so I used AES-256-CBC.
I use MacOS with LibreSSL 3.3.6
I removed the -legacy command but it does not resolve the problem at all. Anyone know how to enable [--openssl-legacy-provider](https://nodejs.org/docs/latest-v17.x/api/cli.html#--openssl-legacy-provider) on Typescript? Thank you.
Is this error reported because the certificate is not available error outputting keys and certificates 94120000:error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:crypto\evp\evp_fetc h.c:373:Global default library context,Algorithm (RC2-40-CBC:0),Properties()
How are these comments possibly classified as abuse? It must have been a mistake as the comments provide a more full context and have no indication of abusive language or behavior.
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
Activity
introspection3 commentedon Oct 31, 2021
tniessen commentedon Oct 31, 2021
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 -nooutThis should print a list of objects and algorithms, e.g.,
introspection3 commentedon Nov 1, 2021
introspection3 commentedon Nov 1, 2021
tniessen commentedon Nov 1, 2021
@564064202 The error is most likely due to the use of
pbeWithSHA1And40BitRC2-CBCin the PKCS#12 file, in particular, because of RC2.RC2 is disabled by default in Node.js 17 and can only be enabled through the legacy provider, see
--openssl-legacy-provider.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.
introspection3 commentedon Nov 1, 2021
tniessen commentedon Nov 1, 2021
All releases are listed as GitHub releases in this repository, in the
changelogsdirectory, and in the Node.js blog.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.
tniessen commentedon Nov 1, 2021
Closing this issue as answered. Please let us know if the problem persists after switching to a supported cipher (or enabling the
--openssl-legacy-provideroption if switching to a different cipher is not possible).chucker commentedon Aug 2, 2022
For the curious: with OpenSSL 3, you can use a command like
to modernize the cipher on your
.pfx.val1984 commentedon Sep 12, 2022
My
.pfxhad a passphrase, I was unable to do it in a single piped command but this worked:rachitpant commentedon Sep 22, 2022
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.
I am a spot here because the local system openssl version is LibreSsl 2.8.3 , so i can't seem to run the above commands to upgrade the cipher in
.pfx. But at the same time , node is not accepting the deprecated cipher.val1984 commentedon Sep 22, 2022
Considering the wording in this nodejs.org announcement, it seems that yes, node has its own copy of openssl.
rachitpant commentedon Sep 22, 2022
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
ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:error has something to do with the fact that the system openssl version is different. This could also be an error with http-proxy that vite uses internally, but the also all of this ( including https proxying) was working earlier.Updating test only pfx because RC2 is no longer supported in Node
trevor-webster commentedon Feb 13, 2023
@tniessen , I am getting a mac verify error with Node 18 LTS, even with the following info:
openssl pkcs12 -in ./myCertificate.p12 -infoThe same cert is working with curl
val1984 commentedon Feb 14, 2023
sha1is insecure and deprecated.I guess it works with
curlbecause it might be usingopensslwith an option to keep accepting older cyphers.Have you tried chucker command or my commands?
Iv3li0s commentedon Feb 16, 2023
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 )
openssl pkcs12 -certpbe PBE-SHA1-3DES -inkey KEY_FILE.key -in CERT_FILE.crt -certfile PARENT_CERT.crt -export -out PFX_FILE.pfxbitconym commentedon Apr 27, 2023
Thanks for the example, for me
PBE-SHA1-3DESstill didn't work, so I usedAES-256-CBC.I use MacOS with LibreSSL 3.3.6
Quang810 commentedon Jul 14, 2023
I have tried both of these commands but on my machine, openssl reports there's no legacy option:
openssl pkcs12 -in my_pfx_file.pfx -legacy -nodes -out decryptedPfxFile.tmp unknown option '-legacy' usage: pkcs12 [-aes128 | -aes192 | -aes256 | -camellia128 | -camellia192 | -camellia256 | -des | -des3 | -idea] [-cacerts] [-CAfile file] [-caname name] [-CApath directory] [-certfile file] [-certpbe alg] [-chain] [-clcerts] [-CSP name] [-descert] [-export] [-in file] [-info] [-inkey file] [-keyex] [-keypbe alg] [-keysig] [-LMK] [-macalg alg] [-maciter] [-name name] [-nocerts] [-nodes] [-noiter] [-nokeys] [-nomac] [-nomaciter] [-nomacver] [-noout] [-out file] [-passin arg] [-passout arg] [-password arg] [-twopass]NEOSHarley commentedon Jul 31, 2023
@Quang810 I had the same problem. Solved it by running the commands on ubuntu instead.
openssl pkcs12 -in oldPfxFile.pfx -nodes -legacy -out decryptedPfxFile.tmpopenssl pkcs12 -in decryptedPfxFile.tmp -export -out newPfxFile.pfxDror-Bar commentedon Aug 16, 2023
On mac, '-legacy' is an invalid command. So simply remove it from the first command:
openssl pkcs12 -in oldPfxFile.pfx -nodes -out decryptedPfxFile.tmpHowever the second command does nothing to change to encryption (it remains RC2). I used the following command:
openssl pkcs12 -certpbe pbeWithSHA1And3-KeyTripleDES-CBC -in decryptedPfxFile.tmp -export -out newPfxFile.pfxThis seems to have changed the
PKCS7 Encrypted DataEdit: Depending on your situation, you might want to use a different cipher, like
aes-256-ecb(then the command would look like this:)openssl pkcs12 -certpbe aes-256-ecb -in decryptedPfxFile.tmp -export -out newPfxFile.pfxI 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
mrlilililililili commentedon Aug 21, 2023
Is this error reported because the certificate is not available
error outputting keys and certificates 94120000:error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:crypto\evp\evp_fetc h.c:373:Global default library context,Algorithm (RC2-40-CBC:0),Properties()marikaner commentedon Jan 12, 2024
I'd like to point out that the error message could be improved.
Error: unsupportedcould mean anything.nalexn commentedon Jan 30, 2024
If you need to retain the type of the cert container as p12, you can re-encrypt this way (tested on mac):
jpierson-at-riis commentedon May 7, 2024
How are these comments possibly classified as abuse? It must have been a mistake as the comments provide a more full context and have no indication of abusive language or behavior.

flybeye commentedon Jun 3, 2024
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
convert-a-cert-pem-certificate-to-a-pfx-certificate