How to Get a Certificate from an internal CA
All of the steps are completed on the web server. None of them are performed on the machine that is the certificate authority.
Create Certificate - Windows Server 2016+ and Windows 10
Start -> Manage computer certificates
Right-click PersonalĀ ā All TasksĀ ā Request New Certificate...
Next
Next
Under "Active Directory Enrollment Policy" check "Computer"
Click the arrow next to "Details"
Click Properties
Ā
General tab
Friendly name: ex: myserver.mydomain.local
Subject tab
Subject name:Ā
Type: Common Name
Value: FQDN of server, ex: myserver.foray.local
Add
Alternative name:
Type: DNS
Value: FQDN of server, ex: myserver.foray.local
Add
Private Key tab
Click āKey optionsā arrow
Key size: 2048
Check "Make private key exportable"
OK
Enroll
Now is a good time to make sure that Certificate Auto-enrollment is set up so that the certificate will auto-renew rather than expire, taking the app/site down.
Ā
Continue with Assign Certificate to WebsiteĀ
Create Certificate - Windows Server pre-2016 and Windows 7
Create a Certificate Signing Request (CSR)
Open the Certificates Snap-in
On the web server
Windows-R (run dialog)
Enter mmc.exe
Click OK
File->Add/Remove Snap-inā¦
Select āCertificatesā
Click Add
Select āComputer accountā
Next
Select āLocal computerā
Click Finish
Click OK (to close Add/Remove Snap-ins
Request a Certificate
Expand Certificates in the MMC Console and select Personal
Right-click on Personal->All Tasks->Advanced Operations->Create Custom Requestā¦
Next
Select āProceed without enrollment policyā
Next
Template: (No template) CNG key
Request format: PKCS #10
Next
Click arrow next to Details
Click Properties
General tab
Friendly name: ex: myserver.mydomain.local
Subject tab
Subject name:Ā
Type: Common Name
Value: FQDN of server, ex: myserver.foray.local
Add
Alternative name:
Type: DNS
Value: FQDN of server, ex: myserver.foray.local
Add
Extensions tab
Key usageĀ
Click āKey usageā arrow
Available options: Digital signature, Add
Available options: Key encipherment, Add
Extended Key Usage
Click āExtended Key Usage (application policies)ā arrow
Available options: Server Authentication, Add
Available options: Client Authentication, Add
Private Key tab
Click āCryptographic Service Providerā arrow
Verify that āRSA, Microsoft Software Key Storage Providerā is checked
Click āKey optionsā arrow
Key size: 2048
Click āSelect Hash Algorithmā arrow
Hash Algorithm: sha256
Click OK
Click Next in Certificate Enrollment window
File Name: ex: C:\Temp\myserver.mydomain.local.csr
NOTE: If the full path isnāt put in the field then the file will be saved to C:\Windows\system32\
File format: Base 64
Click Finish
Sign the Certificate
Sign the CSR File
Still on the web server
Open a command prompt or powershell as an administrator (Run as administrator)
cd into the directory with the CSR
Run the following command
certreq -submit -attrib "CertificateTemplate:WebServer" <CSR FILE NAME>
Ex:certreq -submit -attrib "CertificateTemplate:WebServer" "myserver.mydomain.local.csr"
A āSelect Certification Authorityā dialog will appear. Choose the CA that should sign the certificate and click OK.
A āSave Certificateā dialog will appear. Enter a file name. Ex: myserver.domain.local.cer
Click Save
The output should include āCertificate retrieved(Issued) Issuedā
A .cer file will be created
Copy this file to the web server
Submitting new request does not work
Ā
Complete Certificate Request
On the web server
Run IIS as administrator (right-click Run as administrator)
Select the server
In the IIS section of Features View open Server Certificates
Click āComplete Certificate Requestā¦ā
Select the .cer file
Friendly name: a name to identify the certificate, ex: myserver.domain.local
Select a certificate store for the new certificate: Personal (yes, Personal)
Click OK
Assign Certificate to Website
Select the website, ex: Default Web Site
Click Bindingsā¦
Click Addā¦
Select: https
IP address: All Unassigned or the IP of the site
Port: 443
Host name: leave this blank
SSL certificate: select the certificate competed above
Click OK
Click Close
Test the certificate by going to the root of the server in both IE and Chrome or Firefox
Ex: https://myserver.mydomain.localTest Adams Web and/or Adams Admin as appropriate
Ex: https://myserver.mydomain.local/AdamsWeb
References
How to Request a Certificate With a Custom Subject Alternative Name - This includes an alternate option to generate the request from the command line. If this is used be sure to perform all portions of the request on the requesting server and not on the CA server.
Using Certificate Extensions rather than Request Attributes for Certificate Requests containing SANās - Helpful if the command line request process is used.
Ā© 2023 Foray, LLC - All Rights Reserved