hilda_sonica_vish
hilda_sonica_vish

Reputation: 757

How to install a ssl sertificate from diffrent server to my server,

I want to create a website in my IIS server, (website already has ssl certificate). So i created a site, I have the certificate details which contains certificate, private key , CA certificate (all in one text file).

I havent created a csr request for this, But i need to install this certififcate in my system.

When i followed the steps in complete cerififcate request, first it got added, but when i refresh and came back it was gone.

Please help me how to install certififcate from other server, without creating csr request.?

i have: 1)Certificate: 2)Private key (.key) 3)CA certificate (-ca.crt)

in the text file.

Upvotes: 0

Views: 677

Answers (2)

Crypt32
Crypt32

Reputation: 13974

You can do this with just built-in tool certutil.exe which is shipped with every Windows installation.

  1. make sure SSL certificate file and private key file are stored in the same folder and have same name: mycert.cer and mycert.key, for example. Certificate will have .cer file extension, key file will have .key file extension.
  2. run the following command: certutil -mergepfx path\mycert.cer path\mycert.pfx

this command will merge SSL certificate and private key into PFX container. Enter password when prompted.

Upvotes: 2

rodriguesf53
rodriguesf53

Reputation: 95

You need to convert the text file into *.pfx file so that you can import it on IIS

Open the .key via notepad copy the content and save it in a new notepad say abc.txt

-----BEGIN PRIVATE KEY----- MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDJl/Dwe2tzd5Z6 L4fWpUDVP6FDE9Tc0ViHlICsopxPumysltLwuLFCsc9gCOOURc6n0ej2XQoBJeuetqTIRZQ3VOlHqcmxdBTaAxw5iQ== -----END PRIVATE KEY-----

Now open the certificate via notepad copy the content and paste it in the same abc.txt notepad

-----BEGIN CERTIFICATE----- MIIG5jCCBc6gAwIBAgIQUERflom9AJ4ssjDKLPM3SDANBgkqhkiG9w0BAQsFADBB bS9jcHMwLwYIKwYBBQUHAgIwIwwhaHR0cHM6Ly93d3cudGhhd3RlLmNvbS9yZXBv SzBJMB8GCCsGAQUFBzABhhNodHRwOi8vdGouc3ltY2QuY29tMCYGCCsGAQUFBzAC B7MDaIXp7iniBRfFT3MOMm2Bs3Mju2Hwfhrgg7sf96iQzZkzAU6Mxdux -----END CERTIFICATE-----

Open the -ca.crt via notepad copy the content and paste it in the same abc.txt file (this file will contain intermediate and root certificates)

-----BEGIN CERTIFICATE----- MIIG5jCCBc6gAwIBAgIQUERflom9AJ4ssjDKLPM3SDANBgkqhkiG9w0BAQsFADBB bS9jcHMwLwYIKwYBBQUHAgIwIwwhaHR0cHM6Ly93d3cudGhhd3RlLmNvbS9yZXBv SzBJMB8GCCsGAQUFBzABhhNodHRwOi8vdGouc3ltY2QuY29tMCYGCCsGAQUFBzAC B7MDaIXp7iniBRfFT3MOMm2Bs3Mju2Hwfhrgg7sf96iQzZkzAU6Mxdux -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf /qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 jVaMaA== -----END CERTIFICATE-----

At the end, your abc.txt file will have something like this

-----BEGIN PRIVATE KEY----- MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDJl/Dwe2tzd5Z6 L4fWpUDVP6FDE9Tc0ViHlICsopxPumysltLwuLFCsc9gCOOURc6n0ej2XQoBJeue tqTIRZQ3VOlHqcmxdBTaAxw5iQ== -----END PRIVATE KEY----- -----BEGIN CERTIFICATE----- MIIG5jCCBc6gAwIBAgIQUERflom9AJ4ssjDKLPM3SDANBgkqhkiG9w0BAQsFADBB bS9jcHMwLwYIKwYBBQUHAgIwIwwhaHR0cHM6Ly93d3cudGhhd3RlLmNvbS9yZXBv SzBJMB8GCCsGAQUFBzABhhNodHRwOi8vdGouc3ltY2QuY29tMCYGCCsGAQUFBzAC B7MDaIXp7iniBRfFT3MOMm2Bs3Mju2Hwfhrgg7sf96iQzZkzAU6Mxdux -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIIG5jCCBc6gAwIBAgIQUERflom9AJ4ssjDKLPM3SDANBgkqhkiG9w0BAQsFADBB bS9jcHMwLwYIKwYBBQUHAgIwIwwhaHR0cHM6Ly93d3cudGhhd3RlLmNvbS9yZXBv SzBJMB8GCCsGAQUFBzABhhNodHRwOi8vdGouc3ltY2QuY29tMCYGCCsGAQUFBzAC B7MDaIXp7iniBRfFT3MOMm2Bs3Mju2Hwfhrgg7sf96iQzZkzAU6Mxdux -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf /qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 jVaMaA== -----END CERTIFICATE-----

Download OpenSSL from here Ones installed copy the abc.txt and paste it in the bin path of OpenSSL (e.g. C:\OpenSSL\bin)

Open the CMD, change directory to the bin folder of OpenSSL and paste the below command in CMD

openssl pkcs12 -export -in abc.txt -out xyz.pfx

give any password

You can use the xyz.pfx to import on IIS by using the same set of password

Upvotes: 1

Related Questions