I’m trying to issue a certificate using an existing private key (because key-pinning). I’ve generated the following CSR using openssl:
$ openssl req -new -sha256 -key private/example.org.key -out www.example.org-letsnencrypt.csr
[filled with only basic info]
$ openssl req -text -noout -verify -in /etc/ssl/www.example.org-letsencrypt.csr
Certificate Request:
Data:
Version: 0 (0x0)
Subject: C=BR, O=example.org, CN=www.example.org
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
[...]
Exponent: 65537 (0x10001)
Attributes:
a0:00
Signature Algorithm: sha256WithRSAEncryption
[...]
Result
Running with virtualenv: sudo /home/boppreh/.local/share/letsencrypt/bin/letsencrypt --agree-dev-preview --server https://acme-v01.api.letsencrypt.org/directory auth --csr /etc/ssl/www.example.org-letsencrypt.csr
An unexpected error occurred.
Error: [('asn1 encoding routines', 'ASN1_CHECK_TLEN', 'wrong tag'), ('asn1 encoding routines', 'ASN1_ITEM_EX_D2I', 'nested asn1 error')]
Please see the logfiles in /var/log/letsencrypt for more details.
Stacktrace from logs:
2015-10-27 02:04:22,257:ERROR:letsencrypt.crypto_util:[('asn1 encoding routines', 'ASN1_CHECK_TLEN', 'wrong tag'), ('asn1 encoding routines', 'ASN1_ITEM_EX_D2I', 'nested asn1 error')]
Traceback (most recent call last):
File "/home/boppreh/.local/share/letsencrypt/lib/python2.7/site-packages/letsencrypt/crypto_util.py", line 225, in _get_sans_from_cert_or_req
cert_or_req = load_func(typ, cert_or_req_str)
File "/home/boppreh/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/crypto.py", line 2380, in load_certificate_request
_raise_current_error()
File "/home/boppreh/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue
raise exception_type(errors)
Error: [('asn1 encoding routines', 'ASN1_CHECK_TLEN', 'wrong tag'), ('asn1 encoding routines', 'ASN1_ITEM_EX_D2I', 'nested asn1 error')]
Am I missing something in the CSR creation? Because OpenSSL can read the file just fine and other CAs have accepted similar CSRs with the exact same structure.