Creating CSR with SAN via API calls

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Creating CSR with SAN via API calls

L0 Member

Hi,

I am trying to create CSR via API calls with subject alternate name for hostname and ip address, but I cannot find it in documentation. Simple creation of CSR works for me
https://10.XX.XX.XX/api?type=op&cmd=<request><certificate><generate><certificate-name>apicert</certificate-name><name>testing</name><algorithm><RSA><rsa-nbits>2048</rsa-nbits></RSA></algorithm><digest>sha256</digest><signed-by>external</signed-by><ca>no</ca></generate></certificate></request>&key=

 

But I am trying to insert SAN fields. I tried with:


https://<FW>/api?type=op&cmd=<request><certificate><generate>
<certificate-name>ssl_cert_api_test</certificate-name>
<name>test</name>
<algorithm><RSA><rsa-nbits>2048</rsa-nbits></RSA></algorithm>
<digest>sha256</digest>
<signed-by>external</signed-by>
<ca>no</ca>
<certificate-attributes>
<host-name><member>test_hostname</member></host-name>
<ip><member>90.90.90.90</member></ip>
</certificate-attributes>
</generate></certificate></request>&key=<API_KEY>

 

Error returned

<response status="error" code="17">
<msg>
<line><![CDATA[ request -> certificate -> generate -> certificate-attributes unexpected here]]></line>
<line><![CDATA[ request -> certificate -> generate is unexpected ]]></line>
<line><![CDATA[ request -> certificate is unexpected ]]></line>
<line><![CDATA[ request is unexpected ]]></line>
</msg>
</response>


What I already tried

Replacing <certificate-attributes> with <subject-alt-name> or <altname> blocks:
…<subject-alt-name><host-name>…</host-name><ip>…</ip></subject-alt-name>…
…<altname><host-name>…</host-name><ip>…</ip></altname>…

Same error pattern (code="17" / “unexpected here”).

 

Is there a supported way to pass SAN attributes via single call?

 

1 accepted solution

Accepted Solutions

Community Team Member

Hi @nm2025 ,

 

At this time, adding SANs isn’t supported directly via API. The supported method is to generate the CSR through the CLI or GUI, then export it for signing.

 

If automation is required, you can still leverage the XML API for importing and managing certificates once the CSR with SANs has been generated externally.

LIVEcommunity team member
Stay Secure,
Jay
Don't forget to Like items if a post is helpful to you!

Please help out other users and “Accept as Solution” if a post helps solve your problem !

Read more about how and why to accept solutions.

View solution in original post

2 REPLIES 2

Community Team Member

Hi @nm2025 ,

 

At this time, adding SANs isn’t supported directly via API. The supported method is to generate the CSR through the CLI or GUI, then export it for signing.

 

If automation is required, you can still leverage the XML API for importing and managing certificates once the CSR with SANs has been generated externally.

LIVEcommunity team member
Stay Secure,
Jay
Don't forget to Like items if a post is helpful to you!

Please help out other users and “Accept as Solution” if a post helps solve your problem !

Read more about how and why to accept solutions.

L0 Member

Thank you for clarification,

That works. I used the CLI for CSR creation and the API for all other automation tasks

  • 1 accepted solution
  • 1155 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!