Node-jsonwebtoken: ASN1_CHECK_TLEN error when using jwt.sign with nodejs v4.1.0

Created on 17 Sep 2015  路  2Comments  路  Source: auth0/node-jsonwebtoken

The error :

Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag

If I switch to node v0.12.7 it works fine.

Most helpful comment

I had this problem and it was down to there being something wrong with the private key. I ran the following to fix the key:

openssl rsa -in key.txt -out key.txt

Where key.txt was my private key.

All 2 comments

This is probably a new validation or some change in openssl on node 4.

Verify this:
https://www.ssl247.com/kb/ssl-certificates/troubleshooting/apache/errors-asn1-encoding-routine-apache

I had this problem and it was down to there being something wrong with the private key. I ran the following to fix the key:

openssl rsa -in key.txt -out key.txt

Where key.txt was my private key.

Was this page helpful?
0 / 5 - 0 ratings