Assumption
- We have the IIS server already configured with the Server Certificate.
- It doesn’t matter whether the Certificate is signed by public CA or self signed.
- We would like to use the same Certificate for the purpose required in Apache on Linux.
Step
- Go to IIS manager on Windows IIS Web Server where the Certificate is installed already on.
- Move to Server node in tree.
- Open Server Certificates in middle pane.
- Right click Certificate which you want to use at Apache. And Export..
- Specify name, select pfx format.
- Set the “export password” and OK.
- Copy the pfx file export into the Linux server.
- on Linux, perform the following command so that it can be converted from pfx to text based key and Certificate format. (While exporting, you must enter “export password” 1st, then set the new “key encryption password”.)
$ openssl pkcs12 -in rdweb-export-cert.pfx -out rdweb-export-cert.txt - Open file and see the two parts on text format.
Key part Start from here.
And key part ends with this.
Copy Private key portion to new file and save with name extension “.key”. - Look at the text format file again. and find the Certificate potion.
- Copy Certificate port into new file and save it with name extension “.crt”
- now, ready. You can use it in the Apache SSL config section.
- If you don’t want to protect the key file via the encryption password, use the following command to create the key file getting fully decrypted without password.
$ openssl rsa -in rdweb-cert-2024-10-15.key -out rdweb-cert-2024-10-15.nopass.key