Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API Examples


Generate New SSL Certificate for Grid Manager GUI

Posts: 212
109     1

Here's an example of generating a new Certificate Signing Request.


Step 1: Create CSR

curl -k1 -u admin:infoblox -X POST 'https://gm.blox.corp/wapi/v2.11/fileop?_function=generatecsr' -H 'Content-Type: application/json' -d \
	"certificate_usage" : "ADMIN",
	"cn" : "gm.blox.corp",
	"country" : "US",
	"state" : "California",
	"locality" : "Santa Clara",
	"org" : "Infoblox",
			"value": "gm.blox.corp"
			"value": ""

This call returns a download URL and a token:

    "token": "eJyljssKwjAURH+lZG3z6CtNd5UqCNKCCC5Daa410JdpBEX8d5uFbl24PcOcmSeC+6TNQ1rdA8o8\nlvCUpXEacix4SKlgKw/dTLdE6GLtNGeEMBFglqSY4YA4JpU20Fh51h1IPRIDV6mVX1Sncl/lhU9D\nyqmIwpgLToOIkgaMxRP0aHGr2tYShmZUemjdynpXfnk/KncKFfkxl4fN9hM4RmY7mroFYvvp/xta\nOeevCnq9Ac50WVc=\n", 
    "url": ""

Step 2: Download the generated CSR using the download URL from above:

curl -k -u admin:infoblox -H "Content-type:application/force-download" -O ''

Step 3: Close the file using the token from above:

curl -k1 -u admin:infoblox -X POST 'https://gm.blox.corp/wapi/v2.11/fileop?_function=downloadcomplete' \
-H "Content-Type: application/json" -d \
  "token": "eJyljssKwjAURH+lZG3z6CtNd5UqCNKCCC5Daa410JdpBEX8d5uFbl24PcOcmSeC+6TNQ1rdA8o8\nlvCUpXEacix4SKlgKw/dTLdE6GLtNGeEMBFglqSY4YA4JpU20Fh51h1IPRIDV6mVX1Sncl/lhU9D\nyqmIwpgLToOIkgaMxRP0aHGr2tYShmZUemjdynpXfnk/KncKFfkxl4fN9hM4RmY7mroFYvvp/xta\nOeevCnq9Ac50WVc=\n"

Step 4: Sign the CSR using your preferred Certificate Authority service.  Here's an example for signing a CSR using OpenSSL commands:

openssl x509 -req -days 360 -copy_extensions copyall -in cert.pem -CA ca.crt -CAkey ca.key -CAcreateserial -out gm.blox.corp.crt

Step 5: Initiate an upload for the signed cert generated in the previous step:

curl -k1 -u admin:infoblox -X POST 'https://gm.blox.corp/wapi/v2.11/fileop?_function=uploadinit'

This returns a file upload URL and a token:

    "token": "eJytjk0LgjAYx79K7Jxuj4v5cjMsCKIi6jzELXtAnc0FRfTdc0QdO3X9/V8fRN96tHfpsNUkm4CI\nE0hEytMQuOBMTCfkaptRIWfn+iGjFNIoBJGEEEbUM6nQ6srJEzZaoqFWXySq4Lhbb/MiYJzFwFgE\nKXA+Y5xi2xv7dpOxXJWulLqrjMKu9jPz1ebLW6P8KVLkh1zuF8uP4BkdnLFlralr+z/8QOVLf2fI\n8wX88lob\n", 
    "url": ""

Step 6: Upload the signed cert to the URL specified in the previous step:

curl -k1 -u admin:infoblox -F name=gm.blox.corp.crt -F filedata=@gm.blox.corp.crt ''

Step 7: Apply the uploaded cert as a new SSL cert:

curl -k1 -u admin:infoblox -X POST 'https://gm.blox.corp/wapi/v2.11/fileop?_function=uploadcertificate' -H "Content-Type: application/json" -d \
	"certificate_usage": "ADMIN",
    "token": "eJytjk0LgjAYx79K7Jxuj4v5cjMsCKIi6jzELXtAnc0FRfTdc0QdO3X9/V8fRN96tHfpsNUkm4CI\nE0hEytMQuOBMTCfkaptRIWfn+iGjFNIoBJGEEEbUM6nQ6srJEzZaoqFWXySq4Lhbb/MiYJzFwFgE\nKXA+Y5xi2xv7dpOxXJWulLqrjMKu9jPz1ebLW6P8KVLkh1zuF8uP4BkdnLFlralr+z/8QOVLf2fI\n8wX88lob\n"

The grid manager's web interface will restart automatically.  This may take a minute or two to complete.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You