Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology

Install cert/key via REST API?

I'm curious if anyone has a sample showing the best way to install an existing certificate and key to a BigIP using the REST API. The SOAP API was pretty clear about how this should work, but I haven't been able to find much so far. My example uses Python.

Started with this, hoping the error message would send me down the right path.

create("/sys/crypto/cert", {"name":"TESTCERT", "command":"install"}))

u'Failure detected. Status: 400, Message: must specify at least one of from-editor, from-local-file, or from-url'
Rate this 0

Replies to this 0


Got a little closer on this one. Still no luck with pushing the cert/key contents via the REST call's payload, but was able to load it "from-local-file" and "from-url".

create("/sys/crypto/cert", {"name":"TESTCERT10", "command":"install", "from-local-file":"/var/tmp/wat.txt"}))

create("/sys/crypto/cert", {"name":"TESTCERT11", "command":"install", "from-url":"http://www.symantec.com/content/en/us/enterprise/verisign/roots/Class-3-Public-Primary-Certification-Authority-G2.pem"}))

How to use "from-editor" ?

Doing something like this doesn't work.

{"command":"install","name":"test","from-editor":"-----BEGIN CERTIFICATE-----0MIIFTDCCAzSgAwIBAgIUSJgt4qks-----END CERTIFICATE-----"}