Generating Self-Signed Certificates on Windows: Seven Practical Approaches

When setting up search infrastructure like Easysearch on Windows, developers often need TLS certificates for secure inter-node communication or HTTPS endpoints—even in non-production environments. Since public CAs (e.g., Let’s Encrypt) require domain control and internet-facing validation, self-signed certificates are ideal for local development, internal testing, and isolated clusters. Below are seven distinct, production-safe methods to generate them on Windows—each with clear execution steps and verification guidance.

1. Online Certificate Generator (Browser-Based)

For rapid prototyping without installing tools, certificatetools.com offers a clean, zero-install interface. Select "Self-Signed Certificate", configure subject fields (CN, OU, O), validity period, and key size (e.g., RSA 2048), then click "Generate". It delivers a downloadable .pem bundle containing both certificate and private key—ready for immediate use in Easysearch’s ssl.certs configuraton.

2. Let’s Encrypt via Certbot (Domain-Validated)

This method issues publicly trusted certificates—but requires a resolvable domain and port 80/443 accessibility.

  1. Download and install Certbot for Windows.
  2. Run PowerShell as Administrator and execute:
certbot certonly --standalone -d dev.easysearch.local --preferred-challenges http --non-interactive --agree-tos --email admin@localhost

Certificates appear under C:\Certbot\live\dev.easysearch.local\. To use them in Windows-native services, convert the PEM bundle to PFX:

openssl pkcs12 -export -in cert.pem -inkey privkey.pem -out dev.easysearch.local.pfx -name "Easysearch Dev"

3. OpenSSL CLI (Cross-Platform Control)

Install Win64 OpenSSL, then run:

openssl req -x509 -newkey rsa:2048 -keyout dev-key.pem -out dev-cert.pem -days 730 -nodes -subj "/CN=dev.easysearch.local/O=INFINI Labs/C=CN"

This generates separate dev-cert.pem and dev-key.pem files—ideal for Easysearch’s ssl.certificate and ssl.key settings. Validate with:

openssl x509 -in dev-cert.pem -text -noout | findstr "Subject Not\ After"

4. PowerShell New-SelfSignedCertificate (Native & Scriptable)

Leverage built-in Windows tooling:

$cert = New-SelfSignedCertificate `
  -DnsName "dev.easysearch.local", "localhost" `
  -CertStoreLocation "Cert:\LocalMachine\My" `
  -NotAfter (Get-Date).AddYears(2) `
  -KeyAlgorithm RSA `
  -KeyLength 2048 `
  -HashAlgorithm SHA256 `
  -KeySpec KeyExchange

# Export as PFX (password-protected)
$pwd = ConvertTo-SecureString -String "P@ssw0rd!" -Force -AsPlainText
Export-PfxCertificate -Cert $cert -FilePath dev-easysearch.pfx -Password $pwd

The resulting .pfx can be imported into Easysearch’s keystore or used directly by JVM-based services.

5. IIS Manager GUI (For Web-Centric Workflows)

If IIS is installed:

  1. Open IIS Manager → select server node → double-click Server Certificates.
  2. Click Create Self-Signed Certificate… in the Actions pane.
  3. Enter a friend name (e.g., Easysearch-Dev-Cert) and confirm.

To export: right-click the new cert → All Tasks → Export… → choose .pfx format with private key.

6. Microsoft Management Console (MMC) + Certificates Snap-in

Launch mmc.exe, add the Certificates snap-in for Computer account → navigate to Personal → Certificates → right-click → All Tasks → Request New Certificate. In the wizard, skip enrollment policy, select Web Server template, and populate subject name. No CA required—Windows auto-generates the self-signed version.

7. XCA (GUI for Advanced PKI Scenarios)

XCA is ideal for teams managing multiple test certs with custom extensions (e.g., SANs, key usage flags).

  1. Create a new database (.xdb), set a master password.
  2. Go to Certificates → New Certificate → Self-signed.
  3. In the Subject tab, enter CN=dev.easysearch.local; under Extensions, enable Subject Alternative Name and add DNS:localhost.
  4. Click Create, then Export → PKCS #12 (.pfx) for Easysearch compatibility.

Tags: Easysearch ssl-certificate PowerShell openssl Certbot

Posted on Fri, 04 Sep 2026 16:43:15 +0000 by tenaki