-
Notifications
You must be signed in to change notification settings - Fork 277
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
Error: error:1E08010C:DECODER routines::unsupported (ERR_OSSL_UNSUPPORTED) #4115
Comments
Edit: const b64_publicKey = Buffer.from(myRawKey).toString('base64');
const pemKey = `
-----BEGIN PUBLIC KEY-----
${b64_publicKey}
-----END PUBLIC KEY-----
`;
// use pem key later |
The issue seems to also appear when the key is exported in DER format
the line |
@PlamenHristov can you share what was the curve you were using |
I tried as below on v18.7.0 on macOS intel 13.4. No error was reported
|
@jsmrcaga can you try this code. ref: https://nodejs.org/docs/latest-v19.x/api/crypto.html#cryptocreateverifyalgorithm-options. One of the difference I am seeing is in your code you used 'sha256' whereas in the documentation it is 'SHA256'
|
Hello @preveen-stack ! Or is it maybe because i left the issue open? |
Was just trying to reproduce the issue and wondering if there can be any improvement in error reporting so that the problem can be more narrowed. You may please close the issue as appropriate. |
@jsmrcaga |
@CesarDav I'm guessing you're having the problem on line 47 of your screenshot, however without seeing the value (and please do not share it ^^) it will be hard to identify what your try {
console.log('Formatting in PEM');
createPrivateKey({
key: `-----BEGIN PRIVATE KEY-----${private_key}-----END PRIVATE KEY-----`),
format: 'pem' // this is the default
});
console.log('Success!');
} catch(e) {
console.error('Error', e.message)l
}
try {
console.log('Formatting by removing escaped carriage returns');
createPrivateKey({
key: private_key.replace(/\\n/g,, '\n'),
format: 'pem' // this is the default
});
console.log('Success!');
} catch(e) {
console.error('Error', e.message)l
}
// ... etc and try to find which one works |
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. |
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. |
Details
I'm writing this issue here to prevent other people from finding it in other repos or frmo other libraries.
The initial discussion was found on this issue but should continue here in my opinion since this is an error with how node handles cryptography and not library-specific.
This is what I know, if anyone has any more details they would be greatly appreciated!
I have encountered this error myself trying to verify a signature, the most probable cause was a bad publicKey passed like so:
I would advice anyone reading this, if you are using any type of cryptography:
Node.js version
v19.7.0
but should happen in many other versions (probably 16+)
Example code
This fails on Nodejs v19.7.0
Operating system
MacOS 13.2.1
Scope
runtime + dependencies
Module and version
Not applicable.
The text was updated successfully, but these errors were encountered: