Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
Security

OpenSSL on Windows 11: install it and handle certificates

Install OpenSSL on Windows 11 with winget or Git for Windows, check the version, then create keys and CSRs, read certificates, test TLS and build PFX files.

CloudSat teamNovember 18, 20266 min read
Abstract illustration of a certificate scroll passing through a prism that splits it into key, request and chain layers
On this pagePick a version and a build

OpenSSL is the toolbox behind most certificate work: creating private keys and signing requests, reading certificates, testing a TLS server, and converting between the formats that Linux and Windows expect. The OpenSSL project publishes source code only, so on Windows you install a build made by someone else, or use a copy that came with other software. This guide picks a build, checks it, then walks through the five tasks admins need most.

Pick a version and a build

As of November 2026, the OpenSSL project supports three series: 4.1 (released in October 2026), 4.0, and 3.5, the long-term support release maintained until April 2030. Everything older, including 3.0 and 1.1.1, is out of support and should not be used for new work.

Source How to get it Good for
Shining Light Productions build winget install --id ShiningLight.OpenSSL.Light -e A current, standalone openssl.exe
The same build, LTS line winget search ShiningLight.OpenSSL and pick the LTS package Matching a 3.5 server
Git for Windows Already installed with Git, in C:\Program Files\Git\usr\bin Occasional inspection
WSL openssl inside a Linux distribution Following Linux guides exactly

The .Dev variant of the Shining Light package adds headers and libraries for developers who compile against OpenSSL; the .Light one is enough for the command line.

Install and check it

winget install --id ShiningLight.OpenSSL.Light -e

The installer puts the program in C:\Program Files\OpenSSL-Win64\bin. If a new terminal still says openssl is not recognized, add that folder to your user PATH and open a fresh terminal:

$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$userPath;C:\Program Files\OpenSSL-Win64\bin", "User")

Then confirm which copy runs, because Git, Perl and other tools bring their own:

where.exe openssl
openssl version -a

where.exe lists every openssl.exe on the PATH in the order Windows tries them. openssl version -a shows the version and the folders it reads its configuration and modules from.

Task 1: create a private key and a signing request

A certificate authority needs a certificate signing request (CSR). Modern browsers read only the Subject Alternative Name list, so put every hostname there:

openssl req -new -newkey rsa:3072 -noenc `
  -keyout www.example.com.key -out www.example.com.csr `
  -subj "/CN=www.example.com" `
  -addext "subjectAltName=DNS:www.example.com,DNS:example.com"

-noenc writes the key without a passphrase, which web servers usually need; it replaces the older -nodes flag. For an ECDSA key, create it first and reuse it:

openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out www.example.com.key
openssl req -new -key www.example.com.key -out www.example.com.csr -subj "/CN=www.example.com" -addext "subjectAltName=DNS:www.example.com,DNS:example.com"
openssl req -in www.example.com.csr -noout -text -verify

The last command prints the request and checks its signature. Make sure the names under Subject Alternative Name are right before you send it.

The .key file is the secret half. Keep it out of email and shared folders, and on a shared machine restrict it to your account with icacls www.example.com.key /inheritance:r /grant:r "$($env:USERNAME):F".

Task 2: read a certificate

openssl x509 -in certificate.crt -noout -subject -issuer -dates -ext subjectAltName
openssl x509 -in certificate.crt -noout -fingerprint -sha256

The first command answers the usual questions: who it was issued to, by whom, when it expires, and which names it covers. If OpenSSL complains that it cannot load the certificate, the file is probably binary DER rather than text PEM. Convert it:

openssl x509 -inform der -in certificate.cer -out certificate.pem

Two more checks save time when a server refuses to start with a new certificate. The first confirms that a key and a certificate belong together: both commands print a hash of the public key, and the two hashes must be identical. The second tells a script whether the certificate expires within 30 days.

openssl x509 -in certificate.crt -noout -pubkey | openssl sha256
openssl pkey -in www.example.com.key -pubout | openssl sha256
openssl x509 -in certificate.crt -noout -checkend 2592000; $LASTEXITCODE

An exit code of 0 from the last line means the certificate is still valid 30 days from now; 1 means it expires sooner, which makes it easy to wire into a scheduled task.

Task 3: test a TLS server

"" | openssl s_client -connect www.example.com:443 -servername www.example.com -brief

-brief prints the protocol version, the cipher, the peer certificate and whether the chain verified. The empty string piped in makes the command exit instead of waiting for input.

On Windows, the verification line often reports unable to get local issuer certificate even for healthy public sites. Windows builds of OpenSSL do not read the Windows certificate store by default, so they have no trusted roots to check against. Give them a CA bundle with -CAfile, such as the ca-bundle.crt that Git for Windows ships under C:\Program Files\Git\mingw64\etc\ssl\certs, or the Mozilla bundle published by the curl project. -servername matters: without it, a server that hosts several sites may answer with the wrong certificate. Add -tls1_3 or -tls1_2 to check whether a specific version is accepted, or test mail servers with STARTTLS:

"" | openssl s_client -connect mail.example.com:587 -starttls smtp -servername mail.example.com -brief

Task 4: build a PFX for IIS and other Windows software

Windows imports certificates with their keys as PKCS#12 files (.pfx or .p12). Combine the key, the certificate and the intermediate chain:

openssl pkcs12 -export -out site.pfx -inkey www.example.com.key -in certificate.crt -certfile chain.crt

OpenSSL asks for an export password. OpenSSL 3 and later protect the file with AES by default, which current Windows versions import without trouble. Windows Server 2016 and older ask for the password and then reject it. For those, use the older algorithms explicitly:

openssl pkcs12 -export -out site-legacy.pfx -inkey www.example.com.key -in certificate.crt -certfile chain.crt -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES -macalg sha1

Import the result into the machine store from PowerShell run as administrator:

Import-PfxCertificate -FilePath .\site.pfx -CertStoreLocation Cert:\LocalMachine\My -Password (Read-Host -AsSecureString)

Going the other way, openssl pkcs12 -in site.pfx -nokeys -out certs.pem extracts the certificates and -nocerts -noenc extracts the key.

If you host the site on a CloudSat Windows VPS with IIS, this PFX is the file you bind to the HTTPS site.

Task 5: a self-signed certificate for testing

openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -noenc -days 30 `
  -keyout test.key -out test.crt -subj "/CN=localhost" `
  -addext "subjectAltName=DNS:localhost,IP:127.0.0.1"

Browsers warn about self-signed certificates, which is fine on a test machine and wrong anywhere else. For public sites, use a free certificate from a public authority and automate its renewal.

When it does not work

  • "openssl is not recognized". The bin folder is not on the PATH, or the terminal was opened before you changed it.
  • "Can't open ... openssl.cnf". An OPENSSL_CONF variable set by other software points at a file that no longer exists. Check it with $env:OPENSSL_CONF and remove the stale variable under System > About > Advanced system settings > Environment Variables.
  • Wrong version reported. Another openssl.exe comes first on the PATH; where.exe openssl shows the order.

FAQ

Which OpenSSL version should I install?

The 3.5 LTS line if you want fewer changes until 2030, or the current 4.x release for the newest features. Avoid 3.0 and 1.1.1, which no longer receive fixes.

Is the copy bundled with Git for Windows good enough?

For reading certificates and testing servers, yes, and it updates whenever you update Git. Check openssl version to see which release it is.

Do I need OpenSSL to get a Let's Encrypt certificate for IIS?

No. An ACME client for Windows, such as win-acme, requests, installs and renews the certificate on IIS by itself. OpenSSL is still handy for checking the result.

What is the difference between PEM, CRT, CER and PFX files?

PEM is a text encoding, with BEGIN CERTIFICATE lines, and .crt or .cer files can be PEM or binary DER. A PFX bundles a certificate with its private key, protected by a password, which is the format Windows imports most easily.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.