Page 1 of 1

Certify automatic ssl certificate and renewal

Posted: 2019-11-20 18:18
by alescan
Hi everyone,
I recentrly discovered (The SSL Certificate Manager for Windows, powered by Let's Encrypt) and made a simple script to automatize the renewal process.
You only have to modify the crt and key path and set it in the post-request script page of the program.

Code: Select all

$latest = $result.ManagedItem.CertificatePath
openssl pkcs12 -in $latest -out E:\path\to\private\key\public.key -nocerts -nodes -passin pass:
openssl pkcs12 -in $latest -out E:\path\to\public\crt\public.crt -nokeys -passin pass:
Restart-Service -Name hMailServer -Force
Hope can help some of you!


Re: Certify automatic ssl certificate and renewal

Posted: 2019-12-31 00:49
by bajlek
I need to edit that to this:

Code: Select all

$env:path = $env:path + ";C:\Program Files\OpenSSL-Win64\bin"
$latest = $result.ManagedItem.CertificatePath

openssl pkcs12 -in $latest -out 'C:\Program Files (x86)\hMailServer\ssl\cert\mykey.pem' -nocerts -nodes -passin pass:
openssl pkcs12 -in $latest -out 'C:\Program Files (x86)\hMailServer\ssl\cert\mycert.pem' -nokeys -nodes -chain -passin pass:

Restart-Service -Name hMailServer -Force
I also set PATH in user variables, but it wont even work for powershell so it need to be set up in script. ANd my path have spaces - careful with that.
Reference: ... ystem-path