Hi,
I’m testing out AWS IoT Core integration and when I try read the private key that is issued by Mender I am getting errors. The private key I’m testing can be found in the mender-configure area on the device or in the mender web panel under the device variables.
openssl rsa -noout -modulus -in c:\certs\in.key
unable to load Private Key
34359836736:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag:crypto/asn1/tasn_dec.c:1149:
34359836736:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:crypto/asn1/tasn_dec.c:309:Type=X509_ALGOR
34359836736:error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error:crypto/asn1/tasn_dec.c:646:Field=pkeyalg, Type=PKCS8_PRIV_KEY_INFO
34359836736:error:0907B00D:PEM routines:PEM_read_bio_PrivateKey:ASN1 lib:crypto/pem/pem_pkey.c:88:
Again when using AWS IoT JS Library
opensslErrorStack: [
'error:0907B00D:PEM routines:PEM_read_bio_PrivateKey:ASN1 lib',
'error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error',
'error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error',
'error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag',
'error:04093004:rsa routines:old_rsa_priv_decode:RSA lib',
'error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error',
'error:0D06C03A:asn1 encoding routines:asn1_d2i_ex_primitive:nested asn1 error'
],
library: 'asn1 encoding routines',
function: 'asn1_check_tlen',
reason: 'wrong tag',
code: 'ERR_OSSL_ASN1_WRONG_TAG'
}
Has anyone experienced the same issues? I’ve triple checked the key, made sure there’s no spaces, the begin and end tags are right etc. I’ve copied into notepad and back to make sure there’s no weird character funnies, copied straight from Mender’s device information page too.
I’ve created a new certificate manually in AWS for the “thing” and downloaded a private key through the AWS Console, this works fine using the same code I’m trying.
Really looking forward to figuring out why, using AWS IoT with Mender managing it will be very neat. Maybe there’s something I am missing?
Thank you