NetScaler / Citrix ADC SSL certificate via ACME
NetScaler cannot fetch ACME certificates itself. simple-acme on a Windows server fetches the certificate and transfers it over the NITRO API.
How it works
- Prepare the Windows server Extract the FairSSL edition of simple-acme to C:\simple-acme.
- Create the NITRO user and AutoDNS Create an automation user on NetScaler, store its password in simple-acme's vault, and create the CNAME to FairSSL AutoDNS.
- Issue and install Run wacs.exe with the EAB keys. Install-NetScalerCert.ps1 transfers the certificate over the NITRO API and binds it to the chosen SSL vServer.
- Check Under Traffic Management, SSL, Certificates in NetScaler's web UI, the new certificate must be uploaded and in use.
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.
Supported versions
| Platform | Versions | Runs on | ACME client |
|---|---|---|---|
| NetScaler ADC | VersionsThe guide sets no version limit | Runs onWindows Server 2012 or newer | ACME clientsimple-acme 2.4.0+ (FairSSL edition, .NET 10 included) + NITRO API |
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. If you use the client from simple-acme.com
instead, configure the ACME directory and renewal settings yourself and copy
Install-NetScalerCert.ps1 from the FairSSL edition's Scripts folder to the Scripts folder of
your simple-acme/win-acme installation.
Step 2: Store the NetScaler password
The script logs in to NetScaler with an account that must be allowed to use the NITRO API to upload SSL
files, create or update SSL cert-key pairs, bind certificates and save the configuration. Use a dedicated
automation user if you have one. Run the command from C:\simple-acme as administrator, and
replace YOUR_PASSWORD with the account's password. simple-acme stores it encrypted on the
server. The password cannot contain an apostrophe (') or a double quote (").
# PowerShell, Run as Administrator
.\wacs.exe `
--baseuri "https://fairssl.dk/acme" `
--vaultstore `
--vaultkey vault://json/netscaler `
--vaultsecret 'YOUR_PASSWORD' 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 with your own values in place of
YOUR_EAB_KID, YOUR_EAB_HMAC, ns.example.com, YOUR_NS_HOST,
YOUR_ADC_CERTKEY_NAME and YOUR_VSERVER_NAME, and replace nsadmin
with the NetScaler account from step 2. If you are renewing a certificate already bound to a cert-key, use
that name in -certName. -nsHost can be a hostname, IP address or full URL with port.
.\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" `
--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' -UserName 'nsadmin' -Password '{vault://json/netscaler}'" `
--friendlyname "fairssl-ns-cert"
Password in plain text instead of step 2: replace {vault://json/netscaler} with the password.
simple-acme then saves it in its renewal settings and its log on the server, and a $ or
` in it must have a ` in front. It cannot
contain ' or " either.
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 - NITRO over HTTP: add
-UseHttp, but only on an isolated management network, because the credentials and the private key are sent in cleartext.
Install-NetScalerCert.ps1 prints a command that runs the script again without requesting a new
certificate. If the NetScaler part needs adjusting, change the parameters in that command and run it.
When it works, put the changed parameters into --scriptparameters in the step 4 command and
run that command again, so that renewals use them.
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.
More about what the script does is at the top of the script. To read it, run this from C:\simple-acme:
powershell -NoProfile -ExecutionPolicy Bypass -Command "Get-Help .\Scripts\Install-NetScalerCert.ps1 -Full"
What simple-acme reports to FairSSL after every run, and how to turn it off, is in
C:\simple-acme\fairssl-readme.txt.
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 user name in -UserName or the password from step 2 is wrong, or the account lacks privileges. If the password was changed on NetScaler, run step 2 again with the new one. 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.
SSL certificates on many servers and appliances
A publicly trusted SSL certificate can be valid for at most 199 days now, 99 days by 15-03-2027 and 46 days by 15-03-2029. Each certificate then has to be replaced at least twice a year now and at least eight times a year from 2029, on every server, firewall and load balancer that uses it. sslbrain from FairSSL runs as an appliance in your own network and renews and installs the certificates from one place, including on devices without an agent.
How sslbrain renews and installs certificates on NetScaler(opens sslbrain.com in a new tab)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 order your first certificate. A DV certificate is issued in under 2 minutes.