NetScaler / Citrix ADC SSL certificate via ACME
NetScaler cannot fetch ACME certificates on its own. We use a Windows management server with simple-acme and a ready-made PowerShell script that pushes the certificate to NetScaler via the NITRO API. The whole flow, including renewals, runs without manual intervention.
How the setup is wired
- ✓ Windows Server (an existing management host works) runs simple-acme.
- ✓ simple-acme fetches the certificate from FairSSL via AutoDNS validation. No DNS API keys needed.
- ✓
Install-NetScalerCert.ps1runs as an installation script and pushes the certificate to NetScaler over NITRO REST API on HTTPS. - ✓ The script binds the certificate to one or more SSL vServers (or global VPN binding) and saves the configuration.
- ✓ simple-acme\'s daily scheduled task handles renewal when ARI or the 7-day fallback says so.
Setup
Step 1: Install simple-acme
Grab FairSSL\'s simple-acme build
(pre-configured with the right ACME settings and ships Install-NetScalerCert.ps1 in the
Scripts folder). Extract to C:\simple-acme. Install the CredentialManager module the
script uses to look up credentials safely.
# PowerShell, Run as Administrator
Install-Module CredentialManager -Force -Scope CurrentUser Step 2: Create a NITRO user on NetScaler
On NetScaler: create a dedicated automation user with NITRO permission to upload SSL files, create or update SSL cert-key pairs, bind certificates to SSL vServers and save the configuration. Store the credential in Windows Credential Manager on the management server.
$credential = Get-Credential -UserName "nsadmin" -Message "NetScaler NITRO user"
New-StoredCredential -Target "NetScaler-acme-user" -Credentials $credential -Persist LocalMachine Step 3: Configure AutoDNS
In your FairSSL control panel: create a CNAME for _dnsauth.<your-domain>
pointing at the FairSSL DNS server. One-time setup. See the full
AutoDNS guide.
Step 4: Issue and deploy
Run the command from C:\simple-acme as administrator. Replace YOUR_NS_HOST,
YOUR_ADC_CERTKEY_NAME and YOUR_VSERVER_NAME. If you are renewing a certificate
already bound to a cert-key, use that name in -certName.
wacs.exe --verbose --baseuri "https://fairssl.dk/acme" `
--eab-key-identifier YOUR_EAB_KID --eab-key YOUR_EAB_HMAC --accepttos `
--source manual --host "ns.example.com" --validation none `
--store pemfiles --pemfilespath "C:\simple-acme\Certificates" `
--pemfilesname "ns-example-com" --friendlyname "fairssl-ns-cert" `
--installation script --script ".\Scripts\Install-NetScalerCert.ps1" `
--scriptparameters "-StorePath 'C:\simple-acme\Certificates' -FilePrefix 'ns-example-com' -nsHost 'YOUR_NS_HOST' -certName 'YOUR_ADC_CERTKEY_NAME' -vServerName 'YOUR_VSERVER_NAME' -CredentialTarget 'NetScaler-acme-user'"
Default is -DeploymentMode Auto, which picks SSL cert-key bundle on supported versions and
classic cert-key otherwise. Use -DeploymentMode Classic if the appliance requires the older method.
Step 5: Common variants
- Multiple vServers: use
-vServerName 'VS1,VS2' - SNI bindings: add
-SniCert - Citrix Gateway / global VPN: drop
-vServerNameand add-BindGlobalVpn - Trusted management certificate: add
-ValidateManagementCertificate - HTTPS management is the default:
-UseHttpexists, but only use it on an isolated management network because credentials and private key material are sent unencrypted.
Step 6: Verify
In NetScaler\'s web UI: check under Traffic Management > SSL > Certificates that the new certificate is uploaded and the selected SSL vServer or VPN binding uses it. If the service is public, run the hostname through FairSSL\'s SSL scanner.
Troubleshooting
Script cannot reach NetScaler management
The Windows server has to reach the NetScaler management address on TCP/443 (or TCP/80 if -UseHttp is set, which is not recommended). Check firewall rules, that the management address is reachable over HTTPS, and that the account can log in to the NITRO API.
NITRO returns 401 Unauthorized
The NITRO user stored in Credential Manager lacks privileges. The NetScaler account must be able to read the version and existing cert-key, upload system files, create and update SSL cert-key or SSL cert-key bundle, bind certificates to SSL vServer or global VPN, and save the configuration. Attach a command-policy that covers those NITRO operations.
Certificate uploads but is not bound
Check that -vServerName matches the exact SSL vServer name. Remember -SniCert if you are using SNI. For global VPN binding use -BindGlobalVpn instead of -vServerName.
Frequently asked questions
Find answers to the most common questions about SSL certificates and FairSSL.
Auto mode that asks the appliance for its version and picks SSL cert-key bundle when the ADC version supports it and there is no existing classic cert-key with the same name. Older appliances and global VPN binding use classic SSL cert-key because bundles can only be bound to SSL vServers. Pass -DeploymentMode Classic to force the older method.-ValidateManagementCertificate if the NetScaler management certificate is trusted by the Windows host and you want full TLS validation.-vServerName "VS1,VS2,VS3" in the script parameters. The script binds the same certificate to every listed vServer and saves the configuration at the end.-vServerName and add -BindGlobalVpn. Global VPN binding always uses classic SSL cert-key (not bundles), so the script picks the correct format automatically.Ready to automate NetScaler certificates?
Create a free account and issue your first certificate in under 10 minutes.