# Import SSL certificate

This function uploads a certificate.

Important:

* Due to the limited field length of HTTP GET method calls, you must use the HTTP
POST method. For this reason, you cannot use a cPanel or Webmail session URL to
call this function.
* When you disable the Calendar and Contacts, Receive Mail, Web Disk, Webmail, and
Web Server roles,
the system disables this function.

Endpoint: POST /SSL/upload_cert
Version: 11.136.0.14
Security: BasicAuth

## Query parameters:

  - `crt` (string, required)
    The certificate's contents.
    Example: "\"-----BEGIN CERTIFICATE-----/nMIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQIDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYyMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNVBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3PXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fWvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/daM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6PLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGjUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3WhcDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVwFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2agqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPaKm6r7YmwfLN/YMZBHXSR58oOGP9W/n-----END CERTIFICATE-----\""

  - `friendly_name` (string)
    The certificate's friendly name.
    Example: "TestCert"

## Request fields (multipart/form-data):

  - `crt` (string)
    The certificate file.

  - `friendly_name` (string)
    The certificate's friendly name.

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "upload_cert"

  - `module` (string)
    The name of the module called.
    Example: "SSL"

  - `result` (object)

  - `result.data` (array)

  - `result.data.created` (integer)
    The certificate's creation date.
    Example: 1569844800

  - `result.data.domains` (array)
    A list of the certificate's domains.
    Example: ["example.com"]

  - `result.data.ecdsa_curve_name` (string,null)
    The ECDSA curve that the certificate's key uses.

* prime256v1
* secp384r1
* null — The certificate's key is not an ECDSA key.
    Enum: "prime256v1", "secp384r1"

  - `result.data.ecdsa_public` (string,null)
    The certificate's key's ECDSA compressed public point, in hexadecimal format.

* null — The certificate's key is not an ECDSA key.

  - `result.data.friendly_name` (string)
    The certificate's friendly name.
    Example: "TestCert"

  - `result.data.id` (string)
    The certificate's ID.
    Example: "example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041"

  - `result.data.is_self_signed` (integer)
    Whether the certificate is self-signed.

* 1 — Self-signed.
* 0 — Not self-signed.
    Enum: 1, 0

  - `result.data.issuer.commonName` (string)
    The issuer's Common Name or Distinguished Name.
    Example: "VeriSign Trial Secure Server CA - G2"

  - `result.data.issuer.organizationName` (string)
    The issuer's Organization Name.
    Example: "VeriSign, Inc."

  - `result.data.key_algorithm` (string)
    The certificate's key's algorithm.

* rsaEncryption — RSA.
* id-ecPublicKey — ECDSA.
    Enum: "rsaEncryption", "id-ecPublicKey"

  - `result.data.modulus` (string,null)
    The certificate's key's modulus, in hexadecimal format.

* null — The certificate's key is not an RSA key.
    Example: "a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db"

  - `result.data.modulus_length` (integer,null)
    The length, in bits, of the certificate's key's modulus.

* null — The certificate's key is not an RSA key.
    Example: 2048

  - `result.data.not_after` (integer)
    The certificate's expiration date.
    Example: 1601467200

  - `result.data.not_before` (integer)
    The certificate's start date.
    Example: 1569844800

  - `result.data.signature_algorithm` (string)
    The certificiate's OID hash algorithm signature.
    Example: "sha256WithRSAEncryption"

  - `result.data.subject.commonName` (string)
    The issuer's Common Name or Distinguished Name.
    Example: "example.com"

  - `result.data.validation_type` (string,null)
    The certificate's validation type.

* ev — Extended Validation.
* ov — Organization Validation.
* dv — Domain Validation.
* null — The system could not parse and determine
the certificate's validation type.
    Enum: "ev", "ov", "dv"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    * 1 — Success.
* 0 — Failed. Check the errors field for more details.
    Enum: 1, 0

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


