如何在 Linux 服务器上转换 PFX 证书文件以与 Apache 一起使用? [英] How can I convert a PFX certificate file for use with Apache on a linux server?

查看:33
本文介绍了如何在 Linux 服务器上转换 PFX 证书文件以与 Apache 一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何转换 PFX 证书文件以在 Linux 服务器上与 Apache 一起使用?

How can I convert a PFX certificate file for use with Apache on a linux server?

我从 Windows 证书服务创建了 PFX.PFX 包含整个证书链.(这只是根证书和主证书,没有中间证书.)

I created the PFX from Windows Certificate Services. The PFX contains the entire certificate chain. (Which is just a root and the main cert, no intermediate.)

引导我,聪明的人.

推荐答案

With OpenSSL 您可以使用以下命令将 pfx 转换为 Apache 兼容格式:

With OpenSSL you can convert pfx to Apache compatible format with next commands:

openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.cer
openssl pkcs12 -in domain.pfx -nocerts -nodes  -out domain.key   

第一个命令将公钥提取到 domain.cer.
第二个命令将私钥提取到 domain.key.

First command extracts public key to domain.cer.
Second command extracts private key to domain.key.

使用以下内容更新您的 Apache 配置文件:

Update your Apache configuration file with:

<VirtualHost 192.168.0.1:443>
 ...
 SSLEngine on
 SSLCertificateFile /path/to/domain.cer
 SSLCertificateKeyFile /path/to/domain.key
 ...
</VirtualHost>

这篇关于如何在 Linux 服务器上转换 PFX 证书文件以与 Apache 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆