Sarius
Sarius

Reputation: 57

apache2 won't start cause ssl : "Failed to configure encrypted (?) private key"

I just created a ssl certificate shown here : http://www.tecchannel.de/a/owncloud-9-unter-ubuntu-server-16-04-lts-installieren,3277807,2

now if I start apache I get no error but with service apache2 status I get a error , error log :

[Fri Mar 31 14:55:59.639400 2017] [ssl:error] [pid 21071] AH02579: Init: Private key not found
[Fri Mar 31 14:55:59.639479 2017] [ssl:error] [pid 21071] SSL Library Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
[Fri Mar 31 14:55:59.639494 2017] [ssl:error] [pid 21071] SSL Library Error: error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error
[Fri Mar 31 14:55:59.639504 2017] [ssl:error] [pid 21071] SSL Library Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
[Fri Mar 31 14:55:59.639515 2017] [ssl:error] [pid 21071] SSL Library Error: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error (Type=RSA)
[Fri Mar 31 14:55:59.639526 2017] [ssl:error] [pid 21071] SSL Library Error: error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib
[Fri Mar 31 14:55:59.639536 2017] [ssl:error] [pid 21071] SSL Library Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
[Fri Mar 31 14:55:59.639547 2017] [ssl:error] [pid 21071] SSL Library Error: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error (Type=PKCS8_PRIV_KEY_INFO)
[Fri Mar 31 14:55:59.639553 2017] [ssl:emerg] [pid 21071] AH02311: Fatal error initialising mod_ssl, exiting. See /var/log/apache2/error.log for more information
[Fri Mar 31 14:55:59.639558 2017] [ssl:emerg] [pid 21071] AH02564: Failed to configure encrypted (?) private key localhost:443:0, check /etc/apache2/ssl/apache.crt
AH00016: Configuration Failed

but whats wrong ? the file in /etc/apache2/ssl/apache.crt exists of course ... and why "Private key not found" ? apache.key exists too.

any help ? :(

Upvotes: 5

Views: 34959

Answers (2)

BSB
BSB

Reputation: 2468

While generating CRS request, it generates 2 files

  • example.csr
  • example.key -> You need to include this file in SSL configuration.

Make sure you have included key file in ssl configuration.

Key file should look like :
-----BEGIN PRIVATE KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END PRIVATE KEY-----

Upvotes: 3

Bala Mukunda
Bala Mukunda

Reputation: 46

I think you should recheck your configuration steps.. After creating the .key file you have to give proper permission so that it should readable and writable by root.

Follow the below link which may solve your problem.

https://www.howtoforge.com/how-to-set-up-an-ssl-vhost-under-apache2-on-ubuntu-9.10-debian-lenny

Upvotes: 0

Related Questions