Child pages
  • WHM API 1 Functions - installssl
Skip to end of metadata
Go to start of metadata

 

Description

This function installs an SSL certificate.

Note:

In cPanel & WHM version 60 and later, Mail SNI is always enabled.

  • Functions that enable Mail SNI succeed with a warning that Mail SNI is always enabled.
  • Functions that disable Mail SNI fail and make no changes.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/installssl?api.version=1&domain=example.com&crt=CERTIFICATETEXT&key=KEYTEXT&cab=CABUNDLETEXT&ip=192.168.0.20
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/installssl?api.version=1&domain=example.com&crt=CERTIFICATETEXT&key=KEYTEXT&cab=CABUNDLETEXT&ip=192.168.0.20
 Command Line
whmapi1 installssl domain=example.com crt=-----BEGIN%20CERTIFICATE-----%5Cr%5Cn%20%0AMIIEEzCCAvugAwIBAgIJALF%2FjFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD%5Cr%5Cn%20%0AVQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD%5Cr%5Cn%20%0AVQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l%5Cr%5Cn%20%0AdDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH%5Cr%5Cn%20%0AEwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU%5Cr%5Cn%20%0ABgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ%5Cr%5Cn%20%0ABgNVBAYTAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwu%5Cr%5Cn%20%0AbmV0MRQwEgYDVQQKEwtjUGFuZWwgSW5jLjEOMAwGA1UECBMFVGV4YXMxEDAOBgNV%5Cr%5Cn%20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N0IFJv%5Cr%5Cn%0Ab3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJV%5Cr%5Cn%0AUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJU%5Cr%5Cn%0AcnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k%2B625h8cXyv%5Cr%5Cn%0ARLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz%2BiCWaEVh43KRuH6X4M%5Cr%5Cn%0AypqfpX%2F1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt%2F5%5Cr%5Cn%0A1KiOQswkwB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKz%5Cr%5Cn%0AdcZfHeFhVYAA1IFLezEPI2PnPfMD%2BfQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWl%5Cr%5Cn%0AIjeaY8JIILTbcuPI9tl8vrGvU9oUtCG41tWW4%2F5ODFlitppK%2BULdjG%2BBqXH%2F9Apy%5Cr%5Cn%0AbW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY%5Cr%5Cn%0A-----END%20CERTIFICATE----- ip=192.168.0.20

 


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 

 Output (JSON)
{
   "result":[
      {
         "status":1,
         "statusmsg":"Certificate successfully installed  
          Finished SSL Install Process for example.com (www.example.com).",
         "rawout":"Certificate verification passed<br /> <br />
          The Certificate for the domain example.com was installed on the IP 192.168.0.20.
          </html><br><b>Finished SSL Install Process for example.com      
         (www.example.com).</b>"
      }
   ]
}
 Output (XML)
<installssl>
     <rawout>Certificate verification passed<br /> <br />
      The Certificate for the domain example.com was installed on the IP 192.168.0.20.
     </html><br><b>Finished SSL Install Process for example.com      
     (www.example.com).</b></rawout>
      <status>1</status>
      <statusmsg>Certificate successfully installed
      Finished SSL Install Process for example.com (www.example.com).</statusmsg>
</installssl>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain's name.

A valid domain name.example.com
crtstring

Required

The certificate's text.

A valid SSL certificate.
 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-----%0
keystring

Required

The certificate's key.

A valid private key.
 Click to view...

 -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA4AVM6J4Qg3DIFWr/eJ5GRmIATYsJIepKbrDy70sq+udcO8R8 xxak0oMZ/9mUdpjSNK/fLVTuCO0kxTfQ9VUWJllX7ThD6Zh9ZvlC/nf/OEZLm3Zb nBgu8rbC8E9wuDOkKbJLnINgdhtowIydLK2MJ++q62bFV89jkHWTMcKyyqHENo3h c+lkpd9vnp8rZTinaVb7nX26uQqAFZYRo+WU0G/NPsq40QVSMoqPxyEz4qXo0hvu IlCXmzFZq/6fCVPEKPLhQ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pvP11TabiwqRkqtSEQhSRF0AKTojSW/yyHCZFAawUhV/Z9EKi HmKb97kCgYAyzmFc2it0HqnsOnRybop603nqMtWGTQO4cxa93HUDpYajuK2K3Dfr xUj6lG3z/oKJGGE2JqgZ6LBAhNJtJWJu2ox3pKGE63QjLJnVwb8y1NFYpe/crbLe PuBwIR0L7drXxfv7O5btY7h6QI2d1/UIAQPAWbxLoTM+ndQ/uPEdfA== -----END RSA PRIVATE KEY-----

cabstring

The certificate's CA bundle.

If you do not use this parameter, the system will automatically determine the appropriate CA bundle file to use.

A valid CA bundle.
 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-----
ipstring

The IP address of the certificate's domain.

This parameter defaults to the local IP address for the domain.

 

A valid IP address.192.168.0.20
enable_sni_for_mailBoolean

Whether SNI for mail is enabled.

Note:

We added this parameter in cPanel & WHM version 11.48.

This parameter defaults to 0.

  • 1 — Enabled.
  • 0 — Disabled.
1

Returns

ReturnTypeDescriptionPossible valuesExample
rawoutstring

The function's raw output.

A valid string in HTML format.
 Click to view...

Certificate verification passed<br /> <br />

           The Certificate for the domain example.com was installed on the IP 192.168.0.20.
           </html><br><b>Finished SSL Install Process for example.com     
          (www.example.com).</b>

status

Boolean

Whether the function was successful.

  • 1 — Success.
  • 0 — Failure.
1