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
Error: PEM_read_bio_PUBKEY after upgrade to Node 10.10 #22815
Platform: Linux 4.9.0-8-amd64 deps: update openssl to 1.0.1j #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux (actually, both Ubuntu and Debian, I have bunch of servers running the service)
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 throws
Error: PEM_read_bio_PUBKEY failed
at Verify.verify (internal/crypto/sig.js:122:23)
at Object.verify (/my/project/path/node_modules/jwa/index.js:89:21)
at Object.jwsVerify [as verify] (/my/project/path/node_modules/jws/lib/verify-stream.js:54:15)
at /my/project/path/node_modules/jsonwebtoken/verify.js:116:19
at getSecret (/my/project/path/node_modules/jsonwebtoken/verify.js:76:14)
at Object.module.exports [as verify] (/my/project/path/node_modules/jsonwebtoken/verify.js:80:10)
@YangYu000 Would it be possible to upload public.pem? Actually, any public key that fails would be enough, it is important to include data surrounding the PEM key though, e.g. whitespace.
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.
But I may generate another for test usage, please wait me for one or two days, thanks.
Activity
addaleax commentedon Sep 12, 2018
@nodejs/crypto
tniessen commentedon Sep 12, 2018
This points to #22553, I'll investigate later.
tniessen commentedon Sep 12, 2018
@YangYu000 Would it be possible to upload
public.pem? Actually, any public key that fails would be enough, it is important to include data surrounding the PEM key though, e.g. whitespace.tniessen commentedon Sep 12, 2018
I cannot reproduce this using Node.js 10.9.0 vs 10.10.0 using the code
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.
YangYu000 commentedon Sep 13, 2018
@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.
But I may generate another for test usage, please wait me for one or two days, thanks.
tniessen commentedon Sep 13, 2018
@YangYu000 That would be great! As long as the error message pops up, any key pair would be enough.
tniessen commentedon Sep 24, 2018
Ping @YangYu000.
YangYu000 commentedon Sep 29, 2018
@tniessen Sorry for the delay.
Here's a pem file content ok with node 10.9 and before but fail in 10.10
crypto: make PEM parsing RFC7468-compliant
crypto: make PEM parsing RFC7468-compliant