Skip to main content
10-Marble
May 25, 2023
Question

After importing server.key certificate, Apache is not starting , any solution for this?

  • May 25, 2023
  • 2 replies
  • 1788 views

routines:asn1_d2i_ex_primitive:nested asn1 error
[Mon May 22 20:53:10.720224 2023] [ssl:emerg] [pid 3880:tid 396] SSL Library Error: error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error (Field=version, Type=RSAPrivateKey)
[Mon May 22 20:53:10.720224 2023] [ssl:emerg] [pid 3880:tid 396] SSL Library Error: error:04093004:rsa routines:old_rsa_priv_decode:RSA lib
[Mon May 22 20:53:10.720224 2023] [ssl:emerg] [pid 3880:tid 396] SSL Library Error: error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag
[Mon May 22 20:53:10.720224 2023] [ssl:emerg] [pid 3880:tid 396] SSL Library Error: error:0D06C03A:asn1 encoding routines:asn1_d2i_ex_primitive:nested asn1 error
[Mon May 22 20:53:10.720224 2023] [ssl:emerg] [pid 3880:tid 396] SSL Library Error: error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error (Field=version, Type=PKCS8_PRIV_KEY_INFO)
AH00016: Configuration Failed

 

2 replies

avillanueva
23-Emerald I
23-Emerald I
May 25, 2023
jbailey
18-Opal
May 25, 2023

A few cert related things...

  • Key and Cert need to be base 64 / pem
  • make sure the header/footer have the correct number of "-" (5) (I have seen this issue before where the header got malformed) and there are no spaces in the body

-----BEGIN RSA PRIVATE KEY-----

-----END RSA PRIVATE KEY-----

 

-----BEGIN CERTIFICATE-----

-----END CERTIFICATE-----

 

Potentially, it could also be a corrupted certificate or key file - if the above doesn't work, try regenerating the key/cert