title: CSR Request with Subject Alternative Names via Nitro API (Citrix Netscaler)
body: <p>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.</p>
  <p><a href="https://developer-docs.citrix.com/projects/netscaler-nitro-api/en/12.0/configuration/ssl/sslcertreq/" rel="noreferrer">https://developer-docs.citrix.com/projects/netscaler-nitro-api/en/12.0/configuration/ssl/sslcertreq/</a></p>
  <pre><code>$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
  </code></pre>