Exporting SSL certificates from Windows to Linux Exporting SSL certificates from Windows to Linux L

本文介绍如何从Windows服务器导出SSL证书并转换为适用于Linux服务器的格式。包括使用MMC导出PFX文件,以及利用OpenSSL工具将PFX文件分解为.key和.crt文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

reference : https://secure.springshosting.net/index.php/knowledgebase/28/Exporting-SSL-certificates-from-Windows-to-Linux.html


Exporting SSL certificates from Windows to Linux


Step one: PFX Export on Windows Server

You'll need to get the certificate and key out of Windows into a pfx (PKCS #12) format.

  1. Click Start, Run, then type "mmc" and hit enter.
  2. In the left menu, choose "Add/Remove Snap In".
  3. Click "Add", then click "Certificates", then click OK.
  4. When the wizard starts, select "Computer Account", "Local Computer" and finish the wizard. 
  5. Once the wizard has completed, go back to the MMC and expand the "Certificates" node, then the "Personal" node.
  6. Click on the "Certificates" node under "Personal" and find your certificate in the right panel.
  7. Right-click on the certificate and choose "All Tasks", then "Export".
  8. When the wizard starts, select "Yes" for exporting the private key, then select ONLY "Strong Private Key Protection" from the PFX section.  You will also need to set the password and specify a location to save the PFX file.
  9. After the PFX file has been saved, close out of the MMC. (don’t save the snap-in if it asks).
  10. Upload the PFX file to a linux server , using Filezilla etc.

Step 2: Breaking up the PFX file into .key and .crt
  1. You'll want to decrypt the PFX file into a plantext PEM file.  (NOTE: PFX files are binary files and can't be viewed in a text editor) Type:
    openssl pkcs12 -in file.pfx -out file.pem
  2. You'll be asked for the password for the PFX (which is the one you set in the Windows Wizard).  Once you enter the password, you will be asked for a new password.  You'll want to remember this password for later.
  3. Open up the PEM file in a text editor and copy the private key and certificate key to different files (i.e. file.key and file.crt)
  4. openssl rsa -in file.key -out file.key 
  5. openssl rsa -in file.crt -out file.crt 
  6. That's it.  You now have the .key and .crt file to use on a Linux / Unix server.

example : 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值