---
title: "Create self-signed SSL certificate"
method: GET
path: "/generatessl"
tags: ["SSL", "SSL Server Settings"]
---

# Create self-signed SSL certificate

`GET /generatessl`

This function generates a private key file, a certificate signing request (CSR), and a self-signed SSL certificate.

## Query parameters

- `domains` string, domain, required
- `countryName` string, ISO-3166-1 (alpha-2)
- `emailAddress` string, email
- `keysize` integer
- `localityName` string
- `organizationalUnitName` string, nullable
- `organizationName` string
- `pass` string, nullable
- `skip_certificate` 1 | 0
- `stateOrProvinceName` string

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `cert` string, base64 certificate — The certificate's text.
    - `cert_id` string — The certificate's ID.
    - `certfile` string, path — The absolute file path to the certificate's location.
    - `csr` string, base64 certificate — The CSR's text.
    - `csr_id` string — The CSR's ID.
    - `csrfile` string, path — The absolute file path to the CSR.
    - `key` string, base64 certificate — The private key's text.
    - `key_id` string — The private key's ID.
    - `keyfile` string, path — The absolute file path to the private key.
    - `sender` string — The username that generated the request.
    - `sender_host` string, domain — The host that generated the request.
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds.
    - `result` 0 | 1 — * `1` — Success. * `0` — Failed. Check the `reason` field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
