Certificates
Certificates
Certificates can be found with the .mmc certificates snapin
Export option with key to allow import to another computer
Find certificate authority:
| |
Update Certificates
| |
Update Certificate on IIS server:
| |
- import certificate to cert store
- open IIS go to default website / whatever site needs cert updating > edit bindings > 443 > select new certificate In powershell to restart iis to pick up new certificate:
| |
Update cert on ADFS server:
- Import certificate to cert store Run the following powershell command:
| |
- in ADFS management > service > Certificates > Renew Service Communications certificate with the new certificate
Update on ADFS Proxy server:
- import certificate Check certificate bindings for adfs proxy:
| |
Apply new certificate:
| |
If you dont want to worry about copy pasting the thumbprint of the certificates you can access them in the cert store in powershell:
| |
Then you can just use $cert.Thumbprint instead of copying the thumbrint to the set command or getting it from the cert store cert properties and removing all the spaces.
Extract .crt
if you need cert in .crt format with key for ssl you can use open ssl to extract the keys.
download from here https://slproweb.com/products/Win32OpenSSL.html
When installing make sure to add to environment variables and PATH to use easily from the command line - go to sysdm.cpl or run the following commands for a one time use:
| |
Use the following command to extract when running openssl as admin:
| |
This will extract the cert to a text file where you can grab the public and private keys and save them in text as a .crt and .key file.
Extract key from .cer file:
| |
Extract the key to encrypted key
| |
Extract unencrypted key
| |
Extract Just certificate
| |
Convert From .pem to pfx
Certificates will need to be converted for use in windows IIS as windows prefers .pfx format
Use the following command
| |
SSL Certificates netsh
Check certificates bound to ports in netsh:
| |
Add certificate to port:
| |
Delete sslcert
| |
Extract Private key from pfx and create new cert
Extract private key:
| |
Extract the public key if required:
| |
Create new certificate from .crt (public key) and .key (Private key) file
| |
Create certificate from lets encrypt output for windows vms
Use the certbot on a server that can receive inbound for the DNS that you want the cert for on ports 80 and 443:
| |
Then use openssl with the generated cert files:
| |
Bind certificates in netsh
Use the following command to check certificate status:
| |
unbind then bind the new certificate with the cert thumbprint:
| |
Check Certificates
Use certutil to check the status of a certificate:
| |
Use cert util GUI to check the different certificate distribution lists for the certs:
| |