Child pages
  • UAPI Functions - SSL::install_ssl
Skip to end of metadata
Go to start of metadata

Description

This function installs an SSL certificate.

Note:

Due to their inherent complexities, SSL-related functions often present problems for third-party developers. Our Call UAPI's SSL::install_ssl Function in Custom Code tutorial provides explanations for the additional steps required in order to successfully call this function. 

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/SSL/install_ssl?domain=example.com&cert=THECERTIFICATETEXT&key=THEKEYTEXT&cabundle=THECABUNDLETEXT


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Install a certificate on the example.com domain.
$SSL_install_ssl = $cpanel->uapi(
    'SSL', 'install_ssl',    array(
        'domain'         => 'example.com',
        'cert'           => '-----BEGIN%20CERTIFICATE-----
%0AMIIDNTCCAh2gAwIBAgIFAY0o0kwwDQYJKoZIhvcNAQELBQAwFjEUMBIGA1UEAwwL
%0AZG9tYWluLnRlc3QwHhcNMTcxMDMxMTUyMjU1WhcNMTgxMDMxMTUyMjU1WjAWMRQw
%0AEgYDVQQDDAtkb21haW4udGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
%0AggEBALer6vzwFt%2BO6ooHcXpq%2Bi%2FOVVQEY3oWxrqH6mB%2FPssVSxwcf6bL
joO4so%2Fn%0Adrymhb9mqfkOqYVHwnQ%2Fh2uM%2BIw1NKKDfwOljWcgCS24NykbfQ
UlW%2FSNDTovdDGl%0AT1Aner090Qse%2B19ta8KS%2F3Akz37bkgqMkPO%2FiEOHlF
%2FLbLvjfighkoGco51wc6d7%0AHCQwPWR%2BUenbQWzUwR4%2F4Pqw%2FYrxDAv8O%
2FEnNfOGwnCnlnFq4a390VGriqMAngzI%0AlRMVDu4qJGW3dFNStVUm71%2B16ba%2F
eIVBQGN2rbgie6Rb6VuHdsqSreea0tSLRxdd%0AFd7A0QMQRvtnqoUv6RZBhefr2t0C
AwEAAaOBiT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J6V6e6bR64
eVaH4QwnNOfpSXY%0A-----END%20CERTIFICATE-----',
  )
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Install a certificate on the example.com domain.
my $SSL_install_ssl = $cpliveapi->uapi(
    'SSL', 'install_ssl',    {
        'domain'         => 'example.com',
        'cert'           => '-----BEGIN%20CERTIFICATE-----
%0AMIIDNTCCAh2gAwIBAgIFAY0o0kwwDQYJKoZIhvcNAQELBQAwFjEUMBIGA1UEAwwL
%0AZG9tYWluLnRlc3QwHhcNMTcxMDMxMTUyMjU1WhcNMTgxMDMxMTUyMjU1WjAWMRQw
%0AEgYDVQQDDAtkb21haW4udGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
%0AggEBALer6vzwFt%2BO6ooHcXpq%2Bi%2FOVVQEY3oWxrqH6mB%2FPssVSxwcf6bL
joO4so%2Fn%0Adrymhb9mqfkOqYVHwnQ%2Fh2uM%2BIw1NKKDfwOljWcgCS24NykbfQ
UlW%2FSNDTovdDGl%0AT1Aner090Qse%2B19ta8KS%2F3Akz37bkgqMkPO%2FiEOHlF
%2FLbLvjfighkoGco51wc6d7%0AHCQwPWR%2BUenbQWzUwR4%2F4Pqw%2FYrxDAv8O%
2FEnNfOGwnCnlnFq4a390VGriqMAngzI%0AlRMVDu4qJGW3dFNStVUm71%2B16ba%2F
eIVBQGN2rbgie6Rb6VuHdsqSreea0tSLRxdd%0AFd7A0QMQRvtnqoUv6RZBhefr2t0C
AwEAAaOBiTCBhjAdBgNVHQ4EFgQUeitnD4U4%0AMXtmLX53dTAZPENjovwwHwYDVR0j
BBgwFoAUeitnD4U4MXtmLX53dTAZPENjovww%0ACQYDVR0TBAIwADA5BgNVHREEMjAw
ggtkb21haW4udGVzdIIQbWFpbC5kb21haW4u%0AdGVzdIIPd3d3LmRvbWFpbi50ZXN0
MA0GCSqGSIb3DQEBCwUAA4IBAQ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ANG
NFbjK47PVCLaGKzQUvU7jSAbKt3pDR0IcfiF%2BM6rc86CmZf%2BvAPTN3%2BJwG%2
BcIE%0AcKuYkroIzFWDu9NYiioUI7%2Fa9XdmTvfrT3RSHmup0FoRmlRHD%2FM8%0A
-----END%20RSA%20PRIVATE%20KEY-----',
        'cabundle'       => '-----BEGIN%20CERTIFICATE-----%0AMIIB+
jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9
HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJvb3QwHhcNO
TYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJVUzEYMBYGA1U
EChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJUcnVzdCBSb290M
IGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyvRLfTD0bZZOWTwUK
Ox7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4MypqfpX/1FZSj1aJGg
thoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/51KiOQswkwB6RJ0q1bQa
AYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKzdcZfHeFhVYAA1IFLezEPI
2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWlIjeaY8JIILTbcuPI9tl8vrG
vU9oUtCG41tWW4/5ODFlitppK+ULdjG+BqXH/9ApybW1EDp3zdHSo1TRJ6V6e6bR64
eVaH4QwnNOfpSXY%0A-----END%20CERTIFICATE-----',
 }
);


Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Template Toolkit
<!-- Install a certificate on the example.com domain. -->
[% data = execute( 'SSL', 'install_ssl', { domain => 'example.com', cert => '-----BEGIN%20CERTIFICATE-----
%0AMIIDNTCCAh2gAwIBAgIFAY0o0kwwDQYJKoZI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yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJvb3QwHhcNO
TYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJVUzEYMBYGA1U
EChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJUcnVzdCBSb290M
IGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyvRLfTD0bZZOWTwUK
Ox7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4MypqfpX/1FZSj1aJGg
thoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/51KiOQswkwB6RJ0q1bQa
AYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKzdcZfHeFhVYAA1IFLezEPI
2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWlIjeaY8JIILTbcuPI9tl8vrG
vU9oUtCG41tWW4/5ODFlitppK+ULdjG+BqXH/9ApybW1EDp3zdHSo1TRJ6V6e6bR64
eVaH4QwnNOfpSXY%0A-----END%20CERTIFICATE-----'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username SSL install_ssl domain=example.com cert=THECERTIFICATETEXT key=THEKEYTEXT cabundle=THECABUNDLETEXT


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
 "messages": [
    "The certificate was successfully installed on the domain "example.com"."
  ],
  "errors": null,
  "status": 1,
  "data": {
    "warning_domains": [
       
    ],
    "statusmsg":
 "The SSL certificate is now installed onto the domain "example.com" 
using the IP address "192.168.0.1" The existing virtual host was 
updated with the new certificate. Apache is restarting in the 
background",
    "key_id": "bbe7e_16e2d_df7539f280eb1ecf6c1096190e41ada7",
    "ip": "192.168.0.1",
    "status": 1,
    "working_domains": [
      "example.com"
    ],
    "message":
 "The SSL certificate is now installed onto the domain "example.com" 
using the IP address "192.168.0.1".\nThe existing virtual host was 
updated with the new certificate. Apache is restarting in the 
background.\n",
    "domain": "example.com",
    "servername": "example.com",
    "html":
 " The SSL certificate is now installed onto the domain "example.com" 
using the IP address "192.168.0.1".\n \nThe existing virtual host was 
updated with the new certificate. Apache is restarting in the 
background.",
    "cert_id": "example_com_bbe7e_16e2d_1369007999_1d87a0cdb540f5aae607b10e9a1a82fb",
    "user": "username",
    "action": "update",
    "aliases": "",
    "extra_certificate_domains": [
       
    ]
  }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain name.

A valid domain name.

example.com
certstring

Required

The certificate to install.

A valid certificate.

Note:

You must URI-encode this value.

 Click to view...
-----BEGIN CERTIFICATE-----\r\n MIIEEzCCAvugAwIBAgIJALF/jFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD\r\n VQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD\r\n VQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l\r\n dDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH\r\n EwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU\r\n BgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ\r\n BgNVBAYTAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwu\r\n bmV0MRQwEgYDVQQKEwtjUGFuZWwgSW5jLjEOMAwGA1UECBMFVGV4YXMxEDAOBgNV\r\n BAcTB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRO0AP\r\n N5XtjDqkEyJ6ctfYqUtt9yUXyRuCETFjW6opNLSmZSHeF6L2aZka646lhj02CFyl\r\n kzsNSxysN66tY+WZcTmvgPisJdQFpFvjroJZgDjYRV0QqokKdRy/5BU0+tHXoYpj\r\n 9JOQlbvEWxiGR3R80sL1ma4AfSE6Gv8M/PULTadan51eHaikXqjOXdPJQKuWP3g9\r\n FnIuf38WRYwzGrre88qsZrpsMrADX5dotHWgqAf7Tap6xfA4CUAgQo9tldariuVi\r\n Bz+sRJ/Sjgxnhw1HYWGttBuBZFhMpdHpPnTJ7DIFMd/FN5gG/tah30SapWpo35Ux\r\n 3BpJcdUjtazy82K5AgMBAAGjUDBOMB0GA1UdDgQWBBQAlv7/tALOYb7zAXbYG2+9\r\n AMI3xjAfBgNVHSMEGDAWgBQAlv7/tALOYb7zAXbYG2+9AMI3xjAMBgNVHRMEBTAD\r\n AQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCxzpe71Hc7Es0dqIN7bhIFYIIgcr6wxM6a\r\n a9d+QG+QPH0x0KAqV8EgUbZysvyxEF0bPxW3ZAr1Is1wk80PMuU3bToFFVbFFIIr\r\n HRNfKLGvxiMXnZA1c6L4N0lowvXHgZxTTUXtDFLXyrcwrLsvUErEV7rbizuxqfPw\r\n caRtXn4uc+t6HYuW7yWesBauCWnJNiKbjN/F+uCTurN3QMAeWf3ZJtsfkAgk8dyq\r\n R/83a3kDtSPrpt+jX+qdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P/AAGc+\r\n ZUhYoWcRWKw/y6gI7Ru++9+8+wkadL9EbKMZxhVwD5qVm4ZlWK2a\r\n -----END CERTIFICATE-----
keystring

Required

The certificate's key.

A valid key.

Note:

You must URI-encode this value.

 Click to view...

-----BEGIN RSA PRIVATE KEY-----\r\n
MIIEpAIB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IGVOwHtyVnW/ZfLr\r\n
c1DLIK8Cx8aHfoxffwzoMO5SEQSooeZfOLhsfDN1AoGBAKQTUEINsj+75psgbAr6\r\n
ELGgItJ9yPBLVRr+cUzEpx9LDWVvjMihpP4NX1gq8EOPWT+ewLHVmmsjCyV6xw8J\r\n
XXF8e2xif3in0m3D/wCzE7u2T06rKM3B017hKnrZmGoHnrqPU2osM4sOUpshWX6d\r\n
v1Q4EF1+fbK3YCW+VpCBsB9NAoGAQo+uhNLODee56iKkzpjXWCsFTq6ar3hD5F3P\r\n
63buKdNwhd2GlSPhXFbf+7M5GWW6BZk6rMvv7EOAVice2uvyFm8/4/1WbmF8R+T7\r\n
LX1rPLO5p/m701QpvP11TabiwqRkqtSEQhSRF0AKTojSW/yyHCZFAawUhV/Z9EKi\r\n
HmKb97kCgYAyzmFc2it0HqnsOnRybop603nqMtWGTQO4cxa93HUDpYajuK2K3Dfr\r\n
xUj6lG3z/oKJGGE2JqgZ6LBAhNJtJWJu2ox3pKGE63QjLJnVwb8y1NFYpe/crbLe\r\n
PuBwIR0L7drXxfv7O5btY7h6QI2d1/UIAQPAWbxLoTM+ndQ/uPEdfA==\r\n
-----END RSA PRIVATE KEY-----

cabundlestringThe Certificate Authority (CA) bundle data, if the certificate requires it.

A valid string.

Note:

You must URI-encode this value.

 Click to view...

-----BEGIN CERTIFICATE-----\r\n
MIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYD\r\n
VQQKEw9HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJv\r\n
b3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJV\r\n
UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJU\r\n
cnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyv\r\n
RLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4M\r\n
ypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/5\r\n
1KiOQswkwB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKz\r\n
dcZfHeFhVYAA1IFLezEPI2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWl\r\n
IjeaY8JIILTbcuPI9tl8vrGvU9oUtCG41tWW4/5ODFlitppK+ULdjG+BqXH/9Apy\r\n
bW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY\r\n
-----END CERTIFICATE-----

Returns

ReturnTypeDescriptionPossible valuesExample
actionstringThe action that the function used to install the certificate.A valid string.update
cert_idstringThe certificate ID.A valid string.
 Click to view...
example_com_bbe7e_16e2d_1369007999_1d87a0cdb540f5aae607b10e9a1a82fb
domainstringThe domain that the certificate covers.A valid domain name.example.com
htmlstringThe results, in HTML format.A valid string.
 Click to view...
The SSL certificate is now installed onto the domain "example.com" 
using the IP address "192.168.0.1".\n \nThe existing virtual host was updated with the new certificate. Apache is restarting in the 
background.
ipstringThe domain's IP address.A valid IP address.
192.168.0.1
key_idstringThe key ID.A valid string.
bbe7e_16e2d_df7539f280eb1ecf6c1096190e41ada7
messagestringThe results, in text format.A valid string.
 Click to view...
The SSL certificate is now installed onto the domain "example.com" 
using the IP address "192.168.0.1".\nThe existing virtual host was 
updated with the new certificate. Apache is restarting in the 
background.\n
statusmsgstringThe results, in text format.A valid string.
 Click to view...
The SSL certificate is now installed onto the domain "example.com" 
using the IP address "192.168.0.1" The existing virtual host was 
updated with the new certificate. Apache is restarting in the 
background
The SSL certificate is now installed onto the domain "example.com" 
using the IP address "192.168.0.1" The existing virtual host was 
updated with the new certificate. Apache is restarting in the 
background
userstringThe domain's owner.A valid username.example
warning_domainsstringThe domains that the certificate does not cover.A list of valid domain names.warning.com
working_domainsstringThe domains that the certificate covers.A list of valid domain names.example.com
extra_certificate_domains
stringThe domains that require extra certificates for mail and other services.A list of valid domain names.ssl.example.com