Apachenetworking服务器:SSL证书不明白

我正在尝试向Apache Web服务器指定一个SSL证书,但是我收到了一些奇怪的错误。 不幸的是,我不太了解SSL。 有人能帮助我吗?

错误login/var/log/apache2/error.log:

[Mon Jan 11 16:32:23 2016] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag [Mon Jan 11 16:32:23 2016] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error [Mon Jan 11 16:32:23 2016] [error] SSL Library Error: 67710980 error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib [Mon Jan 11 16:32:23 2016] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag [Mon Jan 11 16:32:23 2016] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error [Mon Jan 11 16:34:18 2016] [error] Init: Private key not found [Mon Jan 11 16:34:18 2016] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag [Mon Jan 11 16:34:18 2016] [error] SSL Library Error: 218640442 error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error [Mon Jan 11 16:34:18 2016] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag [Mon Jan 11 16:34:18 2016] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error [Mon Jan 11 16:34:18 2016] [error] SSL Library Error: 67710980 error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib [Mon Jan 11 16:34:18 2016] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag [Mon Jan 11 16:34:18 2016] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error 

我以这种方式configuration了SSL:

 Listen 443 <VirtualHost _default_:443> JkMount /* loadbalancer SSLEngine on SSLCertificateFile /path/to/domainname.crt SSLCertificateKeyFile /path/to/domainname.key </VirtualHost> 

SSL提供商提供的文件是.ca-bundle, .p7c, .combined, .crt, .csr, .key, .key.pem.

Apache如何才能理解SSL。 请让我知道。 谢谢。

更新

根据蒂姆的build议,我确实给这些文件打电话,他们看起来如下:

cat file_name.crt:

 ---BEGIN CERTIFICATE--- Random Characters ---END CERTIFICATE-- 

cat file_name.key

  ---BEGIN CERTIFICATE--- Random Characters ---END CERTIFICATE-- 

cat file_name.key.pem

 Bag Attributes friendlyName: domain_name.com localKeyID: some integers here Key Attributes: <No Attributes> -----BEGIN PRIVATE KEY----- Random Characters -----END PRIVATE KEY----- 

wrong tag是你有的最好的指标。 Apache假定你的密钥和证书是这样的。 检查您参考的文件是否符合这些标准。

证书

 -----BEGIN CERTIFICATE----- xxxxxxx -----END CERTIFICATE----- 

 -----BEGIN PRIVATE KEY----- xxxxxxx -----END PRIVATE KEY----- 

如果你指向一个带有这样的附加元数据的文件,你会得到上述错误。

 Certificate: Data: Version: 1 (0x0) Serial Number: xx:yy:zz... Signature Algorithm: sha1WithRSAEncryption ................ -----BEGIN CERTIFICATE----- xxxxxx -----END CERTIFICATE-----