Wired Intelligent Edge (Campus Switching and Routing)

Upcoming community maintenance Oct. 27th through Oct. 29th
For more info click here
Reply
Highlighted
Occasional Contributor II

AOS-S CSR from REST API wrong format?

Hello all,

 

I want to generate CSR via the REST API of AOS-S switches. 

I can generate the CSR with no problem, but the API seems to return a wrong formatted CSR request. 

 

The documentation says it returns a base64 encoded pem csr, but that isn't the case. 

I can get the CSR from the CLI and that is correct and works fine.

 

My API call to generate is:

POST.../crypto_pki/create_csrCsrConfigDetailLocalCertificateDetailCreates CSR for given Certificate Name, TA Profile and returns the Certificate Signed Request.

 

This returns a JSON with value 'certificate_detail_base64_encoded'

The following call returns the same value:

GET.../crypto_pki/local_certificate/{LocalCertificateDetail.certificate_name}N/ALocalCertificateDetailReturns the CSR matching the given Local Certificate Name.

 

For reference here is what the API gives me:

 

LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0NCk1JSUJvekNDQVF3Q0FRQXdZekVVTUJJR0ExVUVBeE1MVTNkcGRHTm9YekkxTkRBeEN6QUpCZ05WQkFzVEFrbFVNDQpRNHdEQVlEVlFRS0V3VkJhWEpKVkRFVU1CSUdBMVVFQnhNTFRHRnVaMlZ1YUdGblpXNHhDekFKQmdOVkJBZ1RBaw0KUkZNUXN3Q1FZRFZRUUdFd0pFUlRDQm56QU5CZ2txaGtpRzl3MEJBUUVGQUFPQmpRQXdnWWtDZ1lFQWw0SEVlSzINCjlONVVYYW9TNFg1NjZIVXFGL2U0QndoZktBdWh3UldwZWIrbkV6c2JDOHBQVXJuelBEWUdNSmtBY3l6L21zaEYyDQpxam1mK1M3dmtIb21TY1o3cG81SHVuOUZZS0xoaXVnU0lvUmZOeXd4K3plbVdrZDh4bGxVY0pLcEFpSEtiSmRvRA0KVUs1cUtIWEF1bnlKM1hqWFEzRmw4WWtiZUJqL0tsQjlPVUNBd0VBQWFBQU1BMEdDU3FHU0liM0RRRUJCUVVBQTQNCkdCQUEyT25rVTQ0N20vZ3VyQUo3RzVyeUhrNit6OVN5ZGdoUnFTTzhBMXBFYTlMOWlJTGRjYmlvaVFlbTRMUVk3DQpRZHYwall3endKQjhKenBhME5Na0hsb0lHK3lWWVdHN3ZyTklkTElVb214MkllQXdOSkFZUG5RN1pZcm5rdm0wOQ0KWVVFUStVVjFHS3ZXVHpnb2t3dWMwV2JyMXhxeVFYYjlVTTRpYUR1emo0UksNCi0tLS0tRU5EIENFUlRJRklDQVRFIFJFUVVFU1QtLS0tLQ0K

 

 

 

And here is what I get from the CLI (for the exact same CSR that was generated via API):

 

-----BEGIN CERTIFICATE REQUEST-----
MIIBozCCAQwCAQAwYzEUMBIGA1UEAxMLU3dpdGNoXzI1NDAxCzAJBgNVBAsTAklUM
Q4wDAYDVQQKEwVBaXJJVDEUMBIGA1UEBxMLTGFuZ2VuaGFnZW4xCzAJBgNVBAgTAk
RFMQswCQYDVQQGEwJERTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAl4HEeK2
9N5UXaoS4X566HUqF/e4BwhfKAuhwRWpeb+nEzsbC8pPUrnzPDYGMJkAcyz/mshF2
qjmf+S7vkHomScZ7po5Hun9FYKLhiugSIoRfNywx+zemWkd8xllUcJKpAiHKbJdoD
UK5qKHXAunyJ3XjXQ3Fl8YkbeBj/KlB9OUCAwEAAaAAMA0GCSqGSIb3DQEBBQUAA4
GBAA2OnkU447m/gurAJ7G5ryHk6+z9SydghRqSO8A1pEa9L9iILdcbioiQem4LQY7
Qdv0jYwzwJB8Jzpa0NMkHloIG+yVYWG7vrNIdLIUomx2IeAwNJAYPnQ7ZYrnkvm09
YUEQ+UV1GKvWTzgokwuc0Wbr1xqyQXb9UM4iaDuzj4RK
-----END CERTIFICATE REQUEST-----

 

 

 

Am I missing something?

Thanks for your help!


Accepted Solutions
Highlighted
Occasional Contributor II

Re: AOS-S CSR from REST API wrong format?

My bad, got it working.

 

I need to convert them f.e. with:

 

'OpenSSL base64 -d -in .\infile.csr -out outfile.csr'

View solution in original post


All Replies
Highlighted
Occasional Contributor II

Re: AOS-S CSR from REST API wrong format?

My bad, got it working.

 

I need to convert them f.e. with:

 

'OpenSSL base64 -d -in .\infile.csr -out outfile.csr'

View solution in original post

Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: