Letsencrypt wildcart certificte on Windows server

@rmbolger sorry for the messup :no_mouth:

I am successfully able to generate certificate with POSH-ACME. Just need few commands to import the newly generated certificate to RD gateway.

If I use below command;

New-PACertificate ‘*.abc-dc.com’ -AcceptTOS -Contact mohit.agrawal02@infosys.com -DnsPlugin Route53 -PluginArgs $r53Params -Install -force

Will it import the certificate to RD Gateway ? If not what command i should use ?

Please help me with the command for revoking certificate as well :slight_smile:

The command you typed will generate a certificate and add it to the Windows certificate store. But it will not get associated with RD Gateway unless you also use the Set-RDGWCertificate command from Posh-ACME.Deploy. You can either append it to your original command on the pipeline:

New-PACertificate '*.example.com' | Set-RDGWCertificate -RemoveOldCert -Verbose

Or you can use the output from Get-PACertificate like this:

Get-PACertificate '*.example.com' | Set-RDGWCertificate -RemoveOldCert -Verbose

To revoke a certificate, you use Set-PAOrder with the -RevokeCert flag like this.

Set-PAOrder '*.example.com' -RevokeCert

It’s usually not necessary to revoke certificates, though. Only if the private key is compromised or you no longer control a domain.

(In particular, revocation has no effect on rate limits.)

Thanks a lot @rmbolger Does it mean that i need to have both ‘posh-acme’ and ‘posh-acme.deploy’ in order to generate and associate certificate with RD gateway ?? Or I can use Set-RDGWCertificate after generating certificate from ‘posh.acme’ ?

You’ll need to have both modules installed in order to have access to both sets of functions, yes. You don’t need to use them in the same command if you don’t want to. You can generate the cert with Posh-ACME and then separately use Posh-ACME.Deploy to add the cert to RD Gateway. That’s totally up to you and how you want to automate things. Personally, I use them both together.

how to generate certificate in staging environment using these ‘posh-acme’ ? I already hit the rate-limit of letsencrypt last week :no_mouth:

Here’s a link to the Posh-ACME tutorial. Perhaps give that a read.

@rmbolger pls see the below output:

Command PS C:\Users\Administrator> Get-PACertificate '*.abc-dc.com' | Set-RDGWCertificate -RemoveOldCert -Verbose
VERBOSE: Setting new RDGW thumbprint value
Set-Item : Access to the object at RDS:\GatewayServer\SSLCertificate\Thumbprint is denied for the cmdlet Set-Item.The
certificate is not valid or you do not have sufficient permissions to perform this operation.
At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\Posh-ACME.Deploy\Public\Set-RDGWCertificate.ps1:43
char:17

  • ... Set-Item RDS:\GatewayServer\SSLCertificate\Thumbprint -Va ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : PermissionDenied: (:slight_smile: [Set-Item], AccessViolationException
    • FullyQualifiedErrorId : PermissionDenied,Microsoft.PowerShell.Commands.SetItemCommand

How to fix this ?

Run PowerShell elevated (as administrator).

Its all done successfully :slight_smile:

@rmbolger Thanks a lot…!!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.