4

Using Nitro API, I am trying to generate a CSR request with Subject Alternative Names (SAN). I have tried several things, but in the end, I am still getting a certificate with no SANs. Below is where I am currently at.

https://developer-docs.citrix.com/projects/netscaler-nitro-api/en/12.0/configuration/ssl/sslcertreq/

$csrPayload = @{
    reqfile = $certREQFileName
    keyfile = $certKEYFileName
    commonname = $commonName
    organizationname = $organization
    organizationunitname = $organizationalUnit
    countryname = $country
    statename = $state
    localityname = $location
    digestmethod = 'SHA256'
    subjectaltname = @{'DNS.1' = $commonName; 'DNS.2' = $alt2; 'DNS.3' = $alt3}
}

$hashtablePayload.'params' = @{'warning' = 'NO'; 'onerror' = 'EXIT';}
$hashtablePayload.sslcertreq = $csrPayload
$jsonPayload = ConvertTo-Json -InputObject $hashtablePayload -Depth 100
jeremy b.
  • 57
  • 1
  • 9
  • subjectaltname is a string according to the docs that you linked, you are giving it an array. Maybe that's the issue? – Remko Dec 09 '20 at 10:26
  • But as shown in the array, I need to pass several subjectaltnames to the single line. I can append the strings together, but what would be the separating delimitator? – jeremy b. Dec 10 '20 at 21:02
  • Did you try `,` ? – Remko Dec 11 '20 at 22:47

0 Answers0