-
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
Error: PEM_read_bio_PUBKEY after upgrade to Node 10.10 #22815
Comments
@nodejs/crypto |
This points to #22553, I'll investigate later. |
@YangYu000 Would it be possible to upload |
I cannot reproduce this using Node.js 10.9.0 vs 10.10.0 using the code const assert = require('assert');
const fs = require('fs');
const jwt = require('jsonwebtoken');
const privateKey = fs.readFileSync('./private.pem');
const publicKey = fs.readFileSync('./public.pem');
const token = jwt.sign('Hello world!', privateKey, { algorithm: 'RS256' });
console.log(token);
const payload = jwt.verify(token, publicKey);
console.log(payload); Valid keys don't produce any errors and any invalid keys I tried produce errors in both versions. It would be helpful to have an example with a key pair that works in previous versions. |
@tniessen sorry, the pem file in code is confidential and currently using widely in my company business, so I can't show it in public. |
@YangYu000 That would be great! As long as the error message pops up, any key pair would be enough. |
Ping @YangYu000. |
@tniessen Sorry for the delay.
|
My code is like
and runs without problem with Node 8 and Node 10.8/10.9 (Ubuntu and Debian, NodeJS offical APT source)
After I upgrade to Node 10.10 yesterday, on
JWT.verify
throwsThe text was updated successfully, but these errors were encountered: