将网站安全证书从Windows IIS传输到Apache

我是从这个网站( https://www.sslshopper.com/move-or-copy-an-ssl-certificate-from-a-windows-server-to-an-apache-server.html )的方向将我的GoDaddy.com证书从Windows Server 2003机器迁移到运行Debian&Apache(v 2.4.10)的服务器。 我将.pfx文件转换为.txt文件并将其打开以提取私钥和证书。 但是,我的文件有三个证书,不仅仅是教程中的证书。 那么,哪一部分是我的SSLCertificateFile,SSLCertificateKeyFile或SSLCertificateChainFile? 我尝试添加顶部作为我的私钥,第二部分作为我的证书,但在Chrome浏览器时,我得到一个'NET:ERR_CERT_AUTHORITY_INVALID'消息导航到我的网站。 任何帮助将不胜感激。

Bag Attributes Microsoft Local Key set: <No Values> localKeyID: 01 00 00 00 Microsoft CSP Name: Microsoft RSA SChannel Cryptographic Provider friendlyName: 921ddddfb37214c2d5593e0c9b386a34_bc31898e-7ad7-4e24-9c39-0088bf3b937a Key Attributes X509v3 Key Usage: 10 -----BEGIN ENCRYPTED PRIVATE KEY----- Some Text Here -----END ENCRYPTED PRIVATE KEY----- Bag Attributes localKeyID: 01 00 00 00 subject=/OU=Domain Control Validated/CN=example.com issuer=/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2 -----BEGIN CERTIFICATE----- More Text here -----END CERTIFICATE----- Bag Attributes friendlyName: Go Daddy Root Certificate Authority G2 subject=/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./CN=Go Daddy Root Certificate Authority - G2 issuer=/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./CN=Go Daddy Root Certificate Authority - G2 -----BEGIN CERTIFICATE----- Other Text here as well -----END CERTIFICATE----- Bag Attributes: <Empty Attributes> subject=/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2 issuer=/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./CN=Go Daddy Root Certificate Authority - G2 -----BEGIN CERTIFICATE----- Last bit of text here -----END CERTIFICATE----- 

(删除证书的文字以方便阅读和安全)

文本:

 -----BEGIN ENCRYPTED PRIVATE KEY----- Some Text Here -----END ENCRYPTED PRIVATE KEY----- 

是一个encryption的PKCS#8私钥,它应该被放置在一个文件中,并且密码被删除:

 openssl pkcs8 -topk8 -inform PEM -in <in file> -nocrypt -out private.key 

请注意,上述命令将要求input密码。

这个private.key文件是由SSLCertificateKeyFile

各部分有:

 -----BEGIN CERTIFICATE----- Text here -----END CERTIFICATE----- 

是你的证书 他们需要被放置在文件中,如下所示:

下面的subject=/OU=Domain Control Validated/CN=example.com是您的站点证书,应放置在由SSLCertificateFile指向的文件中。

最后一个是颁发CA的证书,应该放在一个由SSLCertificateChainFile指向的文件中。

剩余的一个(上述两者之间的一个)是根CA证书,应该已经存储在所有客户端的信任锚logging中。 你不需要做任何事情。