Stand Alone Certificate

V10.0

In this section, you will learn how to order and create a Stand Alone Certificate (including SAN) using the RCL SSL API.

Prerequisites

Before you can use the API you must first :

Authorization

Obtain the API Key in the Subscription > API Key page in the RCL SSL Portal.

You must include the API Key in the authorization header of a request as a Bearer Token.

API Endpoint

The endpoint for making API requests is :

  • https://rclapi.azure-api.net

Subscription

To make a request to the API, you must use your subscription. You can obtain the subscription value from the Subscription > Details page in the RCL SSL Portal.

image

Create a Certificate Order

You will first need to create a certificate order before you can create a Stand Alone certificate.

Send a POST request to :

/prod/v4/ssl/certificate/subscription/{your-subscription}/order/create

Include a Certificate object in the body of the request in JSON format. The following example shows the required properties for the object.

{
    "certificateName" : "shopeneur.com",
    "rootDomain" : "shopeneur.com",
    "challengeType" : "http",
    "email" : "rcl@mail.com",
    "password" : "password123",
    "isSAN": false
}

Example Request

POST /prod/v4/ssl/certificate/subscription/subscr-0000/order/create HTTP/1.1
Host: rclapi.azure-api.net
Content-Type: application/json
Authorization: Bearer resdfre-t435-dkjh-5re6
Content-Length: 229

{
    "certificateName" : "shopeneur.com",
    "rootDomain" : "shopeneur.com",
    "challengeType" : "http",
    "email" : "rcl@mail.com",
    "password" : "password123",
    "isSAN": false
}

The challengeType must be http or dns.

The certificateName is the domain you are requesting the certificate for eg: contoso.com or www.contoso.com , etc.

Example of a rootDomain: If the certificateName is ‘contoso.com’ or ‘www.contoso.com’ or ‘store.contoso.com’ or ‘*.contoso.com’, then the rootDomain for any one of these domains is ‘contoso.com’

Example Response

{
    "certificateName": "shopeneur.com",
    "rootDomain": "shopeneur.com",
    "email": "rcl@mail.com",
    "challengeType": "http",
    "orderUri": "https://acme-staging-v02.api.letsencrypt.org/acme/order/372836193/54357068164",
    "target": "Stand ALone",
    "requestSource": "RCL SSL API V4",
    "subscriptionId": 78,
    "password": "password123",
    "tokens": [
        {
            "tokenName": "4SJDtkeVxwrxlbpQ1yiWQNoUK_7aDlQqEYXT6bby_gk",
            "tokenValue": "4SJDtkeVxwrxlbpQ1yiWQNoUK_7aDlQqEYXT6bby_gk.Pyrl_9Z8qqqO2-0KsE1W0cK3fDa0PlH0dkSw7y0AnV0",
            "challengeType": "HTTP",
            "domain": "shopeneur.com"
        }
    ],
    "isUpdate": false,
    "requestOperation": "createOrder"
}

An orderUri property is returned in the certificate object in the response. You must use this orderUri to schedule the creation of a certificate once you complete the validation challenge.

SAN Certificate

For SAN Certificates, the isSAN property must be set to true.

The certificate name must be a single domain, eg. contoso.com. It must not include commas or additional domains. The additional www or * wild card domain will be added automatically by the API.

Example Request

POST /prod/v4/ssl/certificate/subscription/subscr-0000/order/create HTTP/1.1
Host: rclapi.azure-api.net
Content-Type: application/json
Authorization: Bearer resdfre-t435-dkjh-5re6
Content-Length: 229

{
    "certificateName" : "shopeneur.com",
    "rootDomain" : "shopeneur.com",
    "challengeType" : "http",
    "email" : "rcl@mail.com",
    "password" : "password123",
    "isSAN": true
}

Example Response SAN HTTP Certificate

{
    "certificateName": "shopeneur.com",
    "rootDomain": "shopeneur.com",
    "email": "rcl@mail.com",
    "challengeType": "http",
    "orderUri": "https://acme-staging-v02.api.letsencrypt.org/acme/order/372836193/54371311444",
    "target": "Stand ALone",
    "requestSource": "RCL SSL API V4",
    "isSAN": true,
    "subscriptionId": 78,
    "password": "password123",
    "tokens": [
        {
            "tokenName": "DsqZi7uf5cda-s9sH7JY2q8QO5OpJRsAwSsbjKY0cYA",
            "tokenValue": "DsqZi7uf5cda-s9sH7JY2q8QO5OpJRsAwSsbjKY0cYA.Pyrl_9Z8qqqO2-0KsE1W0cK3fDa0PlH0dkSw7y0AnV0",
            "challengeType": "HTTP",
            "domain": "shopeneur.com"
        },
        {
            "tokenName": "ogJ_w8ZadZ3dYfFpFnvnsydamDSbLX8vgoOrecvYwBw",
            "tokenValue": "ogJ_w8ZadZ3dYfFpFnvnsydamDSbLX8vgoOrecvYwBw.Pyrl_9Z8qqqO2-0KsE1W0cK3fDa0PlH0dkSw7y0AnV0",
            "challengeType": "HTTP",
            "domain": "www.shopeneur.com"
        }
    ],
    "isUpdate": false,
    "requestOperation": "createOrder"
}

Example Response SAN DNS Certificate

{
    "certificateName": "shopeneur.com",
    "rootDomain": "shopeneur.com",
    "email": "rcl@mail.com",
    "challengeType": "dns",
    "orderUri": "https://acme-staging-v02.api.letsencrypt.org/acme/order/372836193/54370947644",
    "target": "Stand ALone",
    "requestSource": "RCL SSL API V4",
    "isSAN": true,
    "subscriptionId": 78,
    "password": "password123",
    "tokens": [
        {
            "tokenName": "_acme-challenge",
            "tokenValue": "Sn9-RtrBEnClr_bqcpJ7ISR7B9J8C5rq9Fj77WdhG0g",
            "challengeType": "DNS",
            "domain": "*.shopeneur.com"
        },
        {
            "tokenName": "_acme-challenge",
            "tokenValue": "BdAWJ4lA7J2nBmgdXmg-cVJ84PDJk6Q-fCPXAlWLEoo",
            "challengeType": "DNS",
            "domain": "shopeneur.com"
        }
    ],
    "isUpdate": false,
    "requestOperation": "createOrder"
}

The Create Certificate Order request may take up to 60s to complete. Provisions must be made to prevent server timeout on a client making the request.

Create a Certificate

Once an order is created for a certificate, you will need to validate that you own or control the domain that you are requesting the certificate for.

To validate the http challenge you will need to place a file at the root of your website. Use the tokenName for the extensionless file name. Use the tokenValue for the file content. For SAN Certificates the API will return two tokenNames and tokenValues for you to place two files in the root of your website.

To validate the dns challenge you will need to add a TXT record with your DNS Registrar. Use the tokenName for the TXT record name and the tokenValue for the TXT record value. For SAN Certificates the API will return two tokenValues for a tokenName for you to place two values for the TXT record.

Once you complete the validation, you can now send a request to schedule the creation of a certificate.

Send a POST request to :

/prod/v4/ssl/certificate/subscription/{your-subscription}/schedule/create

Include a Certificate object in the body of the request in JSON format. The following example shows the required fields for the object.

{
    "certificateName": "shopeneur.com",
    "rootDomain": "shopeneur.com",
    "email": "rcl@mail.com",
    "challengeType": "http",
    "orderUri": "https://acme-staging-v02.api.letsencrypt.org/acme/order/372836193/54357068164",
    "target": "Stand ALone",
    "password": "password123",
    "isSAN": false
}

Note the capital “L” in “Stand ALone”.

You must include the Order Uri in the Certificate object.

Example Request

POST /prod/v3/ssl/certificate/subscription/subscr-0000/schedule/create HTTP/1.1
Host: rclapi.azure-api.net
Content-Type: application/json
Authorization: Bearer resdfre-t435-dkjh-5re6
Content-Length: 296

{
    "certificateName": "shopeneur.com",
    "rootDomain": "shopeneur.com",
    "email": "rcl@mail.com",
    "challengeType": "http",
    "orderUri": "https://acme-staging-v02.api.letsencrypt.org/acme/order/372836193/54357068164",
    "target": "Stand ALone",
    "password": "password123"
    "isSAN": false
}

After you make the post request, a 200 OK response will be returned denoting that the certificate was scheduled for creation.

Example Response

200 OK

Your certificate will be scheduled for creation at a later time. During this process, your domain will be validated based on the challenge you completed. Once the domain is validated, your certificate will be created.

SAN Certificate

For SAN Certificates, the isSAN property must be set to true.

The certificate name must be a single domain, eg. contoso.com. It must not include commas or additional domains. The additional www or * wild card domain will be added automatically by the API.

Example Request SAN Certificate

POST /prod/v3/ssl/certificate/subscription/subscr-0000/schedule/create HTTP/1.1
Host: rclapi.azure-api.net
Content-Type: application/json
Authorization: Bearer resdfre-t435-dkjh-5re6
Content-Length: 296

{
    "certificateName": "shopeneur.com",
    "rootDomain": "shopeneur.com",
    "email": "rcl@mail.com",
    "challengeType": "http",
    "orderUri": "https://acme-staging-v02.api.letsencrypt.org/acme/order/372836193/54371311444",
    "target": "Stand ALone",
    "password": "password123",
    "isSAN": true
}

Accessing the New Certificate

You can access your new certificate using the Get Certificate API

Error Handling

Errors in the API will be returned as plain text in the body of a response, usually with a 400 Bad Request

Example Response

Certificate name is not defined.

Certificate Creation Errors

When you schedule a certificate for creation, during the creation process errors will not be displayed. You will need to view errors in the RCL SSL Portal in the Notifications section.


This site uses Just the Docs, a documentation theme for Jekyll.