Windows systems do not allow retrieving the private key in plain text. When an SSL certificate is imported either through MMC or IIS, the matching private key is bound to the certificate automatically, of course, if the certificate is being imported to the same instance the key was generated on. ” This means your SSL Certificate was able to marry with its private key, and is now ready for binding to its services, export, etc. Note: If your imported SSL certificate and it does not state you have a private key then your private key was either corrupted or never generated on this system. You will have to start from scratch generating a. May 05, 2014  Export the certificate as a.PFX file, include all properties and private key; Import the certificate on IIS; Create a self-signed root authority certificate and export the private key. Certificate Authorities, companies that create real SSL certificates create paths to certificates that can have 1 or more intermediate certificates.

Installing certificate via IIS manager
Importing PFX file

Installing certificate via IIS manager

After you receive the issued certificate, you can use the Internet Information Services Manager to install the certificate on a Microsoft IIS 7 server. The method described below will work only if the certificate request was generated on the same machine using IIS Manager. Please follow the process described below:

  1. Once the certificate is issued and sent to you by the Certificate Authority, save it to the accessible location on your server.
    You can also download the certificate in your account with us. The downloaded zip file will have a *.p7b file which can be used for the certificate installation on IIS.
  2. Open Internet Information Services Manager. For this, go to the Start menu, choose Administrative Tools and select Internet InformationServices (IIS) Manager. Otherwise, access it via Win+R >> inetmgr >> OK.
  3. Click on the required server name and go to the Server Certificates option in the center menu.
  4. Press the Complete Certificate Request button in the Actions right-side section.
  5. This will run the Complete certificate request wizard. Select the certificate file from the Certificate Authority you saved on your machine and give a ‘Friendly name’ to the certificate. Friendly name is not a part of the certificate. It is a local name that you can give to the certificate to distinguish it among the other certificates on the server. After the file is selected and the friendly name is entered, click OK.

    If you are importing the certificate in the PEM-encoded format (the file extension will be *.crt), you may also need to import intermediate and root certificates to the server using Microsoft Management Console. The certificates in the PKCS#7 format (*.cer and *.p7b files) do not require additional actions for importing intermediate certificates separately.

    Note: There is a chance you may receive an error “Cannot find the certificate request associated with this certificate file. A certificate request must be completed on the computer where it was created” or “ASN1 bad tag value met” when importing the certificate.


    To fix it, please cancel the dialogue window of the certificate wizard and press F5 to refresh the list of server certificates. You will see that the certificate is imported, but it will not have a Friendly name. You will be able to assign it to the certificate using MMC.

  6. The imported certificate is now shown in the list of Server Certificates. Now you will need to assign the certificate to the website.
  7. In the Connections left-side menu, select you webserver, expand the Sites menu and choose the website you want to assign the certificate to. After that, click on the Bindings option in the Actions section.
  8. In the Site Bindings window, click Add.
  9. In the Add Site Binding window, choose the following parameters:

    Type – https;IP address – All Unassigned, or your IP address;

    Port – 443;

    SSL certificate – friendly name of the imported certificate.

    After all details are selected, click OK button.

  10. The new binding has been successfully created.

If the site already has https enabled, and if you want to update the SSL certificate, you will need to choose the Edit button in binding for port 443, select a friendly name for the new certificate from the dropdown list and click OK to apply the changes.

The certificate is now installed. If https connection is still not accessible, you may need to restart the website. You can check the certificate installation via https://decoder.link.

Importing PFX file

Create PFX file

If you have the private key in PEM format (.key file), you need to generate the certificate in PKCS#12 format (.pfx).

Use this tool to generate the certificate in PKCS#12. Use your certificate with .crt extension, CA bundle with .ca-bundle extension and the saved key with .key extension.

If there’s an OpenSSL client installed on the server, you can create PFX file out of a certificate in PEM format (.pem, .crt, .cer) or PKCS#7/P7B format (.p7b, .p7c) and the private key using the following commands.

PEM (.pem, .crt, .cer) to PFX

*where “more.crt” is the name of the CA Bundle file

PKCS7/P7B (.p7b, .p7c) to PFX

P7B file must be converted to PEM first:

Next, run:

*where “more.crt” is the name of the CA Bundle file

Then import the certificate with .pfx format to your Windows server.

Import PFX using MMC

  1. Add Certificates (Local Computer) snap-in to MMC following the steps described above.
  2. Once added, right-click on the Personal store >> All Tasks >> Import.
  3. The Certificate Import Wizard will be launched, press Next.
  4. Using the Browse button choose the .pfx file which you want to import on your server, press Next.
  5. Enter the PFX file password. It was specified during creation of the .pfx file. You may select Mark this key as exportable to have an opportunity to export the certificate with the private key from this server later. Then click Next.
  6. In the next dialogue window choose Automatically select the certificate store based on the type of certificate. This will allow MMC to place the certificates from the .pfx file to the corresponding folders if the file also contains intermediate certificates. Click Next.
  7. Click Finish. The certificate has been imported to the server and can be now assigned to the website.

Import PFX using IIS Manager

  1. Launch Internet Information Services Manager (Start > Administrative Tools >> Internet Information Services (IIS) Manager), and choose the server the certificate should be imported on.
  2. Double-click Server Certificates in the center menu.
  3. Click the Import button in the right-side menu:
  4. Locate the PFX file on your machine and specify the password that was used when exporting the certificate. Optionally, you may check Allow this certificate to be exported. Then, click OK:

Assigning a certificate for a website

Once the certificate was imported by any of the methods described above, it will be shown in the list of server certificates in IIS Manager and can be assigned to existing website using IIS.

If the CSR was generated in your browser during the SSL activation

If you used the “Auto-activate” option and saved the Private key to your PC, you’ll need to:

  1. Retrieve that key from your PC.
  2. Download the SSL files from your account.
  3. Combine them into a PFX file.
  4. Import the PFX to the IIS.

Finding your Private Key on Different Servers or Control Panels
Linux-Based (Apache, Nginx, LightHttpd)
Windows Operating Systems
Mac OS X
Tomcat
cPanel
WHM
Plesk
Synology NAS DSM
Webmin
VestaCP
DirectAdmin
Webuzo

What Is a Private Key?

What Is a Private Key?

You’ve received your SSL Certificate, and now you need to install it.

Firstly, let’s go through some basics. Public Key Infrastructure (PKI) security is about using two unique keys: the Public Key is encrypted within your SSL Certificate, while the Private Key is generated on your server and kept secret.

All the information sent from a browser to a website server is encrypted with the Public Key, and gets decrypted on the server side with the Private Key. Together the key pair keeps communication secured, and one key will not work without the other.

How do I get it?

The Private Key is generated with your Certificate Signing Request (CSR). The CSR is submitted to the Certificate Authority right after you activate your Certificate. The Private Key must be kept safe and secret on your server or device, because later you’ll need it for Certificate installation.

Note: all Certificates except Multi-Domains support Private Key generation in your browser. The key is always saved during SSL activation, we never receive this information. That’s why it’s important you save and back it up during the process if you use the in-browser automatic generation method. If the Private Key key file is lost, you’ll need to reissue your Certificate.

Can I generate a new Private Key for my Certificate if I lose the old one?

Yes. You can generate a new private key and CSR, or use the automatic CSR and key generation during Certificate reissue (this option is available for all Certificates except for the Multi-Domains).

What does the Private Key look like?

It looks like a block of encoded data, starting and ending with headers, such as —–BEGIN RSA PRIVATE KEY—– and —–END RSA PRIVATE KEY—–.

You may not get to see this code when generating your CSR. Usually, it gets generated in the background with the CSR, and is automatically saved on your server. The system also fills the corresponding field automatically during installation of your Certificate in some control panels, such as cPanel.

The way this works varies depending on your web server, control panel, or any other tools used for CSR generation. Select the one that applies to you in the following section for specific guidance.

Finding your Private Key on Different Servers or Control Panels

Linux-based (Apache, NGINX, LightHttpd)

Normally, the CSR/RSA Private Key pairs on Linux-based operating systems are generated using the OpenSSL cryptographic engine, and saved as files with “.key” or “.pem” extensions on the server.

But no specific extensions are mandatory for text files in Linux, so the key file may have any name and extension, or no extension at all.

If you remember the whole name of the key file or at least part of it, you can use the following command in your console to find the file and its directory:

The slash symbol in this command implies that the search begins from the root directory of the server. This way you have more file options to view. The name of the file in between the single quotation marks should be the part of the name that you remember. To search for the file by extension, enter “*.key” to view all the files with the “.key” extension on your server.

Iis

Tip: often the name of the file corresponds to the domain name it was generated for e.g. “domain_tld.key” or “domain.tld.pem”.

Here’s another useful command that lets you search files by their content:

This command will return the absolute path to the Private Key file if it’s located on your server.

Windows Operating Systems (IIS, Exchange, Small Business server)

Windows servers don’t let you view the Private Key in plain text format. When you import your Certificate via MMC or IIS, the Private Key is bound to it automatically if the CSR/Key pair has been generated on the same server.

If you need to obtain the Private Key to install your Certificate on a different server, you can export the key in a password protected PFX (PKCS#12) file. To do that, open the MMC Certificates snap-in tools following these steps:

Win+R >> mmc.exe >> OK >> File >> Add/Remove Snap-in >> Certificates >> Add >> Computer account >> Next >> Local computer >> Finish >> OK

Next, go to Certificate Enrollment Requests >> Certificates (if you haven’t completed the Certificate request yet). If you’ve done that, you’d select Personal >> Certificates, then right-click the Certificate >> select All Tasks >> Export. The Export wizard will open, and give you instructions. You can find more detailed instructions here.

Once that’s done, you will see the .pfx file containing your Certificate, CA-Bundle, and Private Key. To extract the key, use this tool. Choose the PKCS12 to PEM option, then upload the file and enter your chosen password.

Mac OS X

The Keychain tool in the Server application of Mac OS X won’t allow you to access the Private Key via the graphic user interface. Instead use the Terminal, by opening /etc/certificates/ directory and clicking the file.

Its name should be something like “*.key.pem”. And the terminal commands to open the file are: cd /etc/certificates/ , then ls , and sudo nano test.key.pem.

Note: to check if the Private Key matches your Certificate, go here. Then paste the Certificate and the Private Key text codes into the required fields and click Match.

Tomcat

If your Tomcat SSL connector is configured in JSSE style, the Private Key must be in a password-protected keystore file with a .jks or .keystore extension. This file, unlike most other cases, is created before the CSR. To extract the Private Key, you’ll need to convert the keystore into a PFX file with the following command:

Generate Private Key Iis

Tips:

  1. “Keystore.jks” should be replaced with your actual keystore name,
  2. “keystore.p12” will be the name of the PKCS12 file you will receive,
  3. <jkskeyalias>, <jkspassword> and <keypassword> are the alias (key and keystore passwords that were entered during keystore generation),
  4. <jkskeyalias>, <jkspassword> and <keypassword> should be replaced with your JKS file alias, its password, and Private Key password.
  5. <newp12password> and <newkeypassword> should be replaced with the passwords you set for your new PKCS12 file and the Private Key.

Install Ssl Certificate With Private Key Iis

After the PKCS12 file is generated, you can convert it to a PEM file with separated CRT, CA-Bundle and KEY files using this tool. Alternatively, use the following command in the terminal:

“Private.key” can be replaced with any key file title you like.

cPanel

  1. SSL/TLS Manager
    a) The simplest way to get the appropriate key used during SSL installation is reflected in the below picture:
    b) Alternatively, you can find the Private key in the Private keys section of the SSL/TLS Manager, which can be located in the cPanel main menu. You will see all the Private Keys ever generated in your cPanel. To view the code of the key, click View & Edit. If there are several keys in that menu, you can copy each of them to find a match with your Certificate code by using this tool.
  2. File manager
    On the homepage of your cPanel, click File manager. Find the folder named “ssl” in the folder tree to the left (see screenshot). That folder will contain another folder named “keys”. This key folder also contains all the keys ever generated in your cPanel.

WHM

WHM stores your private keys and CSR codes in the SSL Storage Manager menu. On the homepage, click SSL/TLS >> SSL Storage Manager. To view the Private Key, click the magnifier icon next to the relevant key in the Key column.

Plesk

Click Domains >> your domain >> SSL/TLS Certificates. You’ll see a page like the one shown below. The key icon with the message “Private key part supplied” means there is a matching key on your server.

To get it in plain text format, click the name and scroll down the page until you see the key code. Alternatively, click the green arrow icon on the right. This will download a PEM file, containing your Private Key, Certificate and CA-Bundle files (if they were previously imported to the server). The files can be opened in any text editor, such as Notepad.

Synology NAS DSM

When generating a CSR in Synology DSM, the Private Key is provided to you in a zip file on the last step. The key code is contained within a server.key file, that can be opened with a text editor, such as Notepad.

Webmin

Webmin works as a graphic user interface (GUI) on top of the command-line interface. There is also a file manager called Filemin, that you can use to browse the server file system and find your Private Key file. Alternatively, go to Others >> Command Shell and run the find or grep command, which you can find in the Linux Operating Systems section above.

VestaCP

Your Private Key needs to be saved during CSR generation, as it will not be available via the graphic user interface.

That said, you may be able to retrieve your Private Key via SSH. It is saved as a temporary file in the “/tmp” folder. The path to the file will look something like this: “/tmp/tmp.npAnkmWFcu/domain.com.key”.

Note: the files in the /tmp directory are deleted every time your server is rebooted, so this is not a safe place to store your Private Key.

To get the path to your key file, use this Linux command:

Where you see “domain.com”, replace this with the actual domain name you generated the CSR for.

The path to your key file can also be found using the grep command:

DirectAdmin

In the up-to-date version of DirectAdmin, your Private Key is saved on the server. Access it in the “Paste a pre-generated Certificate and key” field during installation.

If that section is empty, it may mean the CSR and key were generated elsewhere, or the key was not saved in DirectAdmin due to a glitch. If a glitch happened, try retrieving the key via SSH. Usually it is saved in this directory:

/usr/local/directadmin/data/users/<user>/domains/<domain>.key

Note: <user> and <domain> are your DirectAdmin details.

Generate Ssl Certificate With Private Key Iis Software

Webuzo

On the homepage, find the SSL management section by clicking the Private Keys button. This will display a list of all the Private Keys generated in Webuzo. To see the key code, click the pencil icon to the right under the Option column, as shown in the screenshot below:

To sum up, ways to find your private key fully depend on the interface of the web server where you generate the CSR. If the methods described above did not help you find the private key for your certificate, the only solution would be to generate a new CSR/private key pair and reissue your certificate and to make sure that the key is saved on your server/local computer this time.

Coments are closed
Scroll to top