October 24, 2018

Certificates API

  API Reference, TLS

     

This section covers adding and removing certificates from a zone.

NuevoCloud generates a Let's Encrypt certificate for any domains that do not have a valid certificate. Let's Encrypt certificates are renewed and managed automatically.


List Certificates

Lists all certificates associated with a zone.

Example Request

$ curl https://api.nuevocloud.com/1.0/zones/www.example.com/certificates -u nc_apikey:

Example Response

[
{
"domains": [
"example.com"
],
"expiration_date": "2019-01-02T18:26:09Z",
"id": "727f6bf9-3c2b-44ee-aa51-cfda68fc00cd",
"issuer": "Let's Encrypt"
},
{
"domains": [
"www.example.com"
],
"expiration_date": "2019-01-02T18:26:09Z",
"id": "e0f39e6c-cd28-4301-a9c1-c564511f33c4",
"issuer": "Let's Encrypt"
}
]

List Certificate Details

List the details for a single certificate using the certificate ID.

Example Request

$ curl https://api.nuevocloud.com/1.0/zones/www.example.com/certificates/727f6bf9-3c2b-44ee-aa51-cfda68fc00cd -u nc_apikey:

Example Response

{
"domains": [
"example.com"
],
"expiration_date": "2019-01-02T18:26:09Z",
"id": "727f6bf9-3c2b-44ee-aa51-cfda68fc00cd",
"issuer": "Let's Encrypt"
}

Add Certificates

Add one or more certificates to a zone. Adding a valid unexpired certificate will replace any Let's Encrypt certificate(s) covering the same domains.

The certificateand privatekeyfields are required. The cabundlecan be specified separately or appended to the certificate.

The certificate details for each new certificate is returned.

Example Request

$ curl -X POST -d '[ { "certificate": "CERTIFICATE", "cabundle", "CABUNDLE", "privatekey", "PRIVATEKEY" } ]' https://api.nuevocloud.com/1.0/zones/www.example.com/certificates -u nc_apikey:

Example Response

[
{
"domains": [
"example.com"
],
"expiration_date": "2019-01-02T18:26:09Z",
"id": "727f6bf9-3c2b-44ee-aa51-cfda68fc00cd",
"issuer": "Let's Encrypt"
}
]

Delete a Certificate

Delete a certificate from a zone.

Deleting a Let's Encrypt certificate will cause it to be regenerated. To remove a Let's Encrypt certificate, add a certificate covering the same domain(s).

Example Request

$ curl -X DELETE https://api.nuevocloud.com/1.0/zones/www.example.com/certificates/727f6bf9-3c2b-44ee-aa51-cfda68fc00cd -u nc_apikey:

Example Response

{
"status": "ok"
}