You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

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

Description

This function installs a new SSL certificate on a service.

Important:

You must restart the selected service after you install a new SSL certificate.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/install_service_ssl_certificate?api.version=1&service=exim&crt=CERTIFICATETEXT&cabundle=CABUNDLETEXT&key=KEYTEXT
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/install_service_ssl_certificate?api.version=1&service=cpanel&crt=CERTIFICATETEXT&cabundle=CABUNDLETEXT&key=KEYTEXT
 Command Line
whmapi1 install_service_ssl_certificate service=cpanel crt=CERTIFICATETEXT cabundle=CABUNDLETEXT key=KEYTEXT


Notes:

  • Unless otherwise noted, 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.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
	"data": {
		"service": "cpanel",
		"certificate": "-----BEGIN CERTIFICATE-----\nMIIE3f4g5h7j73f235gy54hvcNAQELBQAwgYYxEDAOBgNVBAcM\nB2hvd097342boi0w389w0BCQEWEmMubGFycnl8293rhqurpg9qfgm5ldDEOMAwG\nA1UECAwFdGV4YXMxCzAJBgNVBAYTAlVTMSEwHwYDVQQDDBhiaW5hcnlhZ2Fpbi5j\ncGFuZWwubmluamExDzANBgNVBAoMBmNwYW5lbDAeFw0yMDA1MTgxODQ3NTFaFw0y\nMTA1MTgxODQ3NTFaMIGGMRAwDgYDVQQHDAdob3VzdG9uMSEwHwYJKoZIhvcNAQkB\nFhJjLmxhcnJ5QGNwYW5lbC5uZXQxDjAMBgNVBAgMBXRleGFzMQswCQYDVQQGEwJV\nUzEhMB8GA1UEAwwYYmluYXJ5YWdhaW4uY3BhbmVsLm5pbmphMQ8wDQYDVQQKDAZj\ncGFuZWwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwgg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5Zk+rHNoCXIQXh4nBzM8X2r3IrQ1\nQh0Z3njN2Ld8ZUlxsWctlLzvzmjARzIzvbglO3wod5XoRLS+fU6oVyQ9yuQLGG6r\n6Y7iBYSHfAO8e0pLkp7G\n-----END CERTIFICATE-----",
		"certificate_info": {
			"issuer.commonName": "null",
			"not_after": 1621363671,
			"modulus": "9832472894729472983427846327846287597cf3e56b000d8525f385338172485adc01a13736977db3c9e5a420090cfde351d7660c6f49176e08a16d9b44b07d178a6a9c5e6b6289ca0cded8c18babb4703105afc4cc748dfdea802b9e74dcd020127dd5d4186b51799eaf3b0c5738f3cae67602bf216a065d67d29436015fc2a3dfd6c21382bd5fc19bd693cee799adb601ffdb96df52cea63b3ed2cd503461efe8f4ef1fc1d9156ffb67d337812c14c5f38e3901c48a21d159f6ff52a713659c636617d8fc837afd2398342794728947238734859283492340294724932048d",
			"modulus_length": 2048,
			"key_algorithm":"rsaEncryption",
			"ecdsa_curve_name":null,
			"ecdsa_public":null,
			"domains": ["example.com"],
			"issuer_text": "localityName\ncity\nemailaddress\nc.example@example.com\nstateOrProvinceName\nstate\ncountryName\nUS\ncommonName\nhostname\norganizationName\ncpanel",
			"issuer.organizationName": "cpanel",
			"is_self_signed": 1,
			"not_before": 1589877123
		},
		"service_description": "Calendar, cPanel, WebDisk, Webmail, and WHM Services"
	},
	"metadata": {
		"reason": "OK",
		"command": "install_service_ssl_certificate",
		"version": 1,
		"result": 1
	}
}
 Output (XML)
XML
<result>
   <data>
      <certificate>-----BEGIN CERTIFICATE-----\nMIIE3f4g5h7j73f235gy54hvcNAQELBQAwgYYxEDAOBgNVBAcM\nB2hvd097342boi0w389w0BCQEWEmMubGFycnl8293rhqurpg9qfgm5ldDEOMAwG\nA1UECAwFdGV4YXMxCzAJBgNVBAYTAlVTMSEwHwYDVQQDDBhiaW5hcnlhZ2Fpbi5j\ncGFuZWwubmluamExDzANBgNVBAoMBmNwYW5lbDAeFw0yMDA1MTgxODQ3NTFaFw0y\nMTA1MTgxOD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TycHc2bsSH+zDkWIw58+J26Re9Q9VnUcrSKtV3mmtW88r8FuEHEZdAOzF\nPTJ3Tdd1fha15wuS5dzOV+bCRrDTvJmD4vRPkQ5TSdyJgpIjpjwiOP1+ZwaF7xZ+\nFLMTcEl8SXM+lkoKEUQpHFKyQ0zGIaLCVt0QyXx16lesPMgPeb/KRXJPy7ZrUtyF\n0z0LgvOSDGNsGt4rD8FVgtdHRlMJf/XIoFeV5Zk+rHNoCXIQXh4nBzM8X2r3IrQ1\nQh0Z3njN2Ld8ZUlxsWctlLzvzmjARzIzvbglO3wod5XoRLS+fU6oVyQ9yuQLGG6r\n6Y7iBYSHfAO8e0pLkp7G\n-----END CERTIFICATE-----"</certificate>
      <certificate_info>
         <domains>
            <element>example.com</element>
         </domains>
         <is_self_signed>1</is_self_signed>
         <issuer.commonName null="true" />
         <issuer.organizationName>cpanel</issuer.organizationName>
         <issuer_text>localityName
city
emailaddress
c.example@example.com
stateOrProvinceName
state
countryName
US
commonName
hostname
organizationName
cpanel</issuer_text>
         <modulus>9832472894729472983427846327846287597cf3e56b000d8525f385338172485adc01a13736977db3c9e5a420090cfde351d7660c6f49176e08a16d9b44b07d178a6a9c5e6b6289ca0cded8c18babb4703105afc4cc748dfdea802b9e74dcd020127dd5d4186b51799eaf3b0c5738f3cae67602bf216a065d67d29436015fc2a3dfd6c21382bd5fc19bd693cee799adb601ffdb96df52cea63b3ed2cd503461efe8f4ef1fc1d9156ffb67d337812c14c5f38e3901c48a21d159f6ff52a713659c636617d8fc837afd2398342794728947238734859283492340294724932048d</modulus>
         <modulus_length>2048</modulus_length>
		 <key_algorithm>rsaEncryption</key_algorithm>
		 <ecdsa_curve_name>null</ecdsa_curve_name>
		 <ecdsa_public>null</ecdsa_public>
         <not_after>1621363671</not_after>
         <not_before>1589877123</not_before>
      </certificate_info>
      <service>cpanel</service>
      <service_description>Calendar, cPanel, WebDisk, Webmail, and WHM Services</service_description>
   </data>
   <metadata>
      <command>install_service_ssl_certificate</command>
      <reason>OK</reason>
      <result>1</result>
      <version>1</version>
   </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionTypeExample
servicestring

Required

The service on which to install the SSL certificate.

Important:

You must restart the selected service after you install a new SSL certificate.


  • ftp
  • exim
  • dovecot
  • mail_apns
  • cpanel
  • courier

    Warnings:

    • We removed the Courier mail server in cPanel & WHM version 54. The Courier mail server only exists for cPanel & WHM version 11.52 and earlier.
    • If you pass the courier value to this parameter on a cPanel & WHM version 54 server, the system returns the following message:

      courier is not a known service.
cpanel
crtstring

Required

The certificate to install.

A valid SSL certificate in Base64 PEM format.

Note:

You must URI-encode this value.

 Click to view...

-----BEGIN CERTIFICATE-----\nMIIE3f4g5h7j73f235gy54hvcNAQELBQAwgYYxEDAOBgNVBAcMB2hvd097342boi0w389w0BCQEWEmMubGFycnl8293rhqurpg9qfgm5ldDEOMAwGA1UECAwFdGV4YXMxCzAJBgNVBAYTAlVTMSEwHwYDVQQDDBhiaW5hcnlhZ2Fpbi5jcGFuZWwubmluamExDzANBgNVBAoMBmNwYW5lbDAeFw0yMDA1MTgxODQ3NTFaFw0yMTA1MTgxODQ3NTFaMIGGMRAwDgYDVQQHDAdob3VzdG9uMSEwHwYJKoZIhvcNAQkBFhJjLmxhcnJ5QGNwYW5lbC5uZXQxDjAMBgNVBAgMBXRleGFzMQswCQYDVQQGEwJVUzEhMB8GA1UEAwwYYmluYXJ5YWdhaW4uY3BhbmVsLm5pbmphMQ8wDQYDVQQKDAZjcGFuZWwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3i1fOlIUoURJf4BkMgoVvCeq5GZjzuCl6WXzz5WsADYUl84UzgXJIWtwBoTc2l32zyeWkIAkM/eNR12YMb0kXbgihbZtEsH0XimqcXmtiicoM3tjBi6u0cDEFr8TMdI396oArnnTc0CASfdXUGGtReZ6vOwxXOPPK5nYCvyFqBl1n0pQ2AV/Co9/WwhOCvV/Bm9aTzueZrbYB/9uW31LOpjs+0s1QNGHv6PTvH8HZFW/7Z9M3gSwUxfOOOQHEiiHRWfb/UqcTZZxjZhfY/IN6/SOsc3Z2t2KmQ5XI6ijCrjjJeaZSQYsge8LpHskr8G3WeTV9M9+1YnI7GRqs3+GdAgMBAAGjggEsMIIBKDAdBgNVHQ4EFgQUYWWThQj2tRL5PNkdPhUJdqEIcrswCQYDVR0TBAIwADCBtwYDVR0jBIGvMIGsgBRhZZOFCPa1Evk82R0+FQl2oQhyu6GBjKSBiTCBhjEQMA4GA1UEBwwHaG91c3RvbjEhMB8GCSqGSIb3DQEJARYSYy5sYXJyeUBjcGFuZWwubmV0MQ4wDAYDVQQIDAV0ZXhhczELMAkGA1UEBhMCVVMxITAfBgNVBAMMGGJpbmFyeWFnYWluLmNwYW5lbC5uaW5qYTEPMA0GA1UECgwGY3BhbmVsggUCGG94JTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwIwYDVR0RBBwwGoIYYmluYXJ5YWdhaW4uY3BhbmVsLm5pbmphMA0GCSqGSIb3DQEBCwUAA4IBAQBhKmds+XDTycHc2bsSH+zDkWIw58+J26Re9Q9VnUcrSKtV3mmtW88r8FuEHEZdAOzFPTJ3Tdd1fha15wuS5dzOV+bCRrDTvJmD4vRPkQ5TSdyJgpIjpjwiOP1+ZwaF7xZ+FLMTcEl8SXM+lkoKEUQpHFKyQ0zGIaLCVt0QyXx16lesPMgPeb/KRXJPy7ZrUtyF0z0LgvOSDGNsGt4rD8FVgtdHRlMJf/XIoFeV5Zk+rHNoCXIQXh4nBzM8X2r3IrQ1Qh0Z3njN2Ld8ZUlxsWctlLzvzmjARzIzvbglO3wod5XoRLS+fU6oVyQ9yuQLGG6r6Y7iBYSHfAO8e0pLkp7G\n-----END CERTIFICATE-----

keystring

Required

The certificate's key.

A valid private key.

Note:

You must URI-encode this value.


 Click to view...

-----BEGIN RSA PRIVATE KEY-----\nMIIE3f4g5h7j73f235gy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bmFyeWFnYWluLmNwYW5lbC5uaW5qYTEPMA0GA1UECgwGY3BhbmVsggUCGG94JTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwIwYDVR0RBBwwGoIYYmluYXJ5YWdhaW4uY3BhbmVsLm5pbmphMA0GCSqGSIb3DQEBCwUAA4IBAQBhKmds+XDTycHc2bsSH+zDkWIw58+J26Re9Q9VnUcrSKtV3mmtW88r8FuEHEZdAOzFPTJ3Tdd1fha15wuS5dzOV+bCRrDTvJmD4vRPkQ5TSdyJgpIjpjwiOP1+ZwaF7xZ+FLMTcEl8SXM+lkoKEUQpHFKyQ0zGIaLCVt0QyXx16lesPMgPeb/KRXJPy7ZrUtyF0z0LgvOSDGNsGt4rD8FVgtdHRlMJf/XIoFeV5Zk+rHNoCXIQXh4nBzM8X2r3IrQ1Qh0Z3njN2Ld8ZUlxsWctlLzvzmjARzIzvbglO3wod5XoRLS+fU6oVyQ9yuQLGG6r6Y7iBYSHfAO8e0pLkp7G\n----END RSA PRIVATE KEY-----

cabundlestring

The certificate's Certificate Authority (CA) bundle.

This parameter defaults to an empty string.

A valid CA bundle.

Note:

You must URI-encode this value.

 Click to view...
-----BEGIN CERTIFICATE-----\r\n
MIIE3f4g5h7j73f235gy54hvcNAQELBQAwgYYxEDAOBgNVBAcM
B2hvd097342boi0w389w0BCQEWEmMubGFycnl8293rhqurpg9qfgm5ldDEOMAwG
A1UECAwFdGV4YXMxCzAJBgNVBAYTAlVTMSEwHwYDVQQDDBhiaW5hcnlhZ2Fpbi5j
cGFuZWwubmluamExDzANBgNVBAoMBmNwYW5lbDAeFw0yMDA1MTgxODQ3NTFaFw0y
MTA1MTgxODQ3NTFaMIGGMRAwDgYDVQQHDAdob3VzdG9uMSEwHwYJKoZIhvcNAQkB
FhJjLmxhcnJ5QGNwYW5lbC5uZXQxDjAMBgNVBAgMBXRleGFzMQswCQYDVQQGEwJV
UzEhMB8GA1UEAwwYYmluYXJ5YWdhaW4uY3BhbmVsL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RXJPy7ZrUtyF
0z0LgvOSDGNsGt4rD8FVgtdHRlMJf/XIoFeV5Zk+rHNoCXIQXh4nBzM8X2r3IrQ1
Qh0Z3njN2Ld8ZUlxsWctlLzvzmjARzIzvbglO3wod5XoRLS+fU6oVyQ9yuQLGG6r
6Y7iBYSHfAO8e0pLkp7G\r\n -----END CERTIFICATE-----

Returns

ReturnTypeDescriptionPossible valuesExample
certificatestringThe SSL certificate's contents.A valid certificate file in Base64 PEM format.
 Click to view...
-----BEGIN CERTIFICATE-----\r\n
MIIE3f4g5h7j73f235gy54hvcNAQELBQAwgYYxEDAOBgNVBAcM
B2hvd097342boi0w389w0BCQEWEmMubGFycnl8293rhqurpg9qfgm5ldDEOMAwG
A1UECAwFdGV4YXMxCzAJBgNVBAYTAlVTMSEwHwYDVQQDDBhiaW5hcnlhZ2Fpbi5j
cGFuZWwubmluamExDzANBgNVBAoMBmNwYW5lbDAeFw0yMDA1MTgxODQ3NTFaFw0y
MTA1MTgxODQ3NTFaMIGGMRAwDgYDVQQHDAdob3VzdG9uMSEwHwYJKoZIhvcNAQkB
FhJjLmxhcnJ5QGNwYW5lbC5uZXQxDjAMBgNVBAgMBXRleGFzMQswCQYDVQQGEwJV
UzEhMB8GA1UEAwwYYmluYXJ5YWdhaW4uY3BhbmVsLm5pbmphMQ8wDQYDVQQKDAZj
cGFuZWwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3i1fOlIUoURJf
4BkMgoVvCeq5GZjzuCl6WXzz5WsADYUl84UzgXJIWtwBoTc2l32zyeWkIAkM/eNR
12YMb0kXbgihbZtEsH0XimqcXmtiicoM3tjBi6u0cDEFr8TMdI396oArnnTc0CAS
fdXUGGtReZ6vOwxXOPPK5nYCvyFqBl1n0pQ2AV/Co9/WwhOCvV/Bm9aTzueZrbYB
/9uW31LOpjs+0s1QNGHv6PTvH8HZFW/7Z9M3gSwUxfOOOQHEiiHRWfb/UqcTZZxj
ZhfY/IN6/SOsc3Z2t2KmQ5XI6ijCrjjJeaZSQYsge8LpHskr8G3WeTV9M9+1YnI7
GRqs3+GdAgMBAAGjggEsMIIBKDAdBgNVHQ4EFgQUYWWThQj2tRL5PNkdPhUJdqEI
crswCQYDVR0TBAIwADCBtwYDVR0jBIGvMIGsgBRhZZOFCPa1Evk82R0+FQl2oQhy
u6GBjKSBiTCBhjEQMA4GA1UEBwwHaG91c3RvbjEhMB8GCSqGSIb3DQEJARYSYy5s
YXJyeUBjcGFuZWwubmV0MQ4wDAYDVQQIDAV0ZXhhczELMAkGA1UEBhMCVVMxITAf
BgNVBAMMGGJpbmFyeWFnYWluLmNwYW5lbC5uaW5qYTEPMA0GA1UECgwGY3BhbmVs
ggUCGG94JTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwIwYDVR0RBBww
GoIYYmluYXJ5YWdhaW4uY3BhbmVsLm5pbmphMA0GCSqGSIb3DQEBCwUAA4IBAQBh
Kmds+XDTycHc2bsSH+zDkWIw58+J26Re9Q9VnUcrSKtV3mmtW88r8FuEHEZdAOzF
PTJ3Tdd1fha15wuS5dzOV+bCRrDTvJmD4vRPkQ5TSdyJgpIjpjwiOP1+ZwaF7xZ+
FLMTcEl8SXM+lkoKEUQpHFKyQ0zGIaLCVt0QyXx16lesPMgPeb/KRXJPy7ZrUtyF
0z0LgvOSDGNsGt4rD8FVgtdHRlMJf/XIoFeV5Zk+rHNoCXIQXh4nBzM8X2r3IrQ1
Qh0Z3njN2Ld8ZUlxsWctlLzvzmjARzIzvbglO3wod5XoRLS+fU6oVyQ9yuQLGG6r
6Y7iBYSHfAO8e0pLkp7G\r\n -----END CERTIFICATE-----
certificate_infoarray of hashesAn array of hashes that contain certificate information data for a service.

This array of hashes contains the is_self_signed, issuer.organizationName, modulus, not_before, modulus_length, not_after, issuer.commonNamesignature_algorithm, validation_type, issuer_text , key_algorithm, ecdsa_curve_name, and ecdsa_public returns, and the domains array.


is_self_signed

Boolean

Whether the certificate is self-signed.

The function returns this value in the certificate_info hash.


  • 1 — Self-signed.
  • 0 — Not self-signed.
 1

signature_algorithm


                
string

The signature algorithm of the certificate.

Note:

We introduced this return in cPanel & WHM version 56.

The function returns this value in the certificate_info hash.

A valid OID hash algorithm name.
sha256WithRSAEncryption

validation_type

string

The certificate's validation type.

Note:

We introduced this return in cPanel & WHM version 56.

The function returns this value in the certificate_info hash.

  • ev — Extended Validation.
  • ov — Organization Validation.
  • dv — Domain Validation.
  • undef — The system could not parse and determine the certificate's validation type.
dv

issuer.organizationName

string

The organization that generated the certificate.

The function returns this value in the certificate_info hash.

A string value.Writer's Guild of America

modulus

string

The certificate's key's modulus, in hexadecimal format.

The function returns this value in the certificate_info hash.

  • A string value.
  • null — The certificate's key is not an RSA key.

Note:

We added the null value in cPanel & WHM version 92.

 Click to view...

a673c3b17344664b35f8791

f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db

not_before

integer

The certificate's validation date, in Unix format.

The function returns this value in the certificate_info hash.

A date in Unix time format. 1367269499

modulus_length

integer

The certificate's key's modulus length.

The function returns this value in the certificate_info hash.

  • An integer value.
  • null — The certificate's key is not an RSA key.

Note:

We added the null value in cPanel & WHM version 92.

2048

not_after

integer

When the certificate expires, in Unix format.

The function returns this value in the certificate_info hash.

A date in Unix time format.1398805499

domains

array

The domains that correspond to the certificate.

The function returns this value in the certificate_info hash.

A list of valid domains on the server.example.com

issuer.commonName

string

The common name of the organization that issued the certificate.

The function returns this value in the certificate_info hash.

A valid domain.example.com

issuer_text

string

Information about the issuer.

The function returns this value in the certificate_info hash.

 A string value.
 Click to view...
countryName\nUS\nstateOrProvinceName\nUnknown\nlocalityName\nUnknown\norganizationName\nUnknown \norganizationalUnitName\nUnknown\ncommonName\nexample.com\nemailAddress\ntest@example.com

key_algorithm

string

The certificate's key's algorithm.

Note:

We added this return in cPanel & WHM version 92.

The function returns this value in the certificate_info hash.

  • rsaEncryption — RSA.
  • id-ecPublicKey — ECDSA.
rsaEncryption

ecdsa_curve_name

string

The ECDSA curve that the certificate's key uses.

Note:

We added this return in cPanel & WHM version 92.

The function returns this value in the certificate_info hash.

  • A valid string.
  • null — The certificate's key is not an ECDSA key.
ecdsa-prime256v1

ecdsa_public

string

The certificate's key's ECDSA compressed public point, in hexadecimal format.

Note:

We added this return in cPanel & WHM version 92.

The function returns this value in the certificate_info hash.

  • A valid string.
  • null — The certificate's key is not an ECDSA key.
02a2cb73408a5833ffbe6eedac9227b9985c54a94990cc4a13ea2a57f3bdecada1

service

stringThe service that the certificate corresponds to.
  • ftp
  • exim
  • dovecot
  • mail_apns
  • cpanel
  • courier

    Warning:

    We removed the Courier mail server in cPanel & WHM version 54. The Courier mail server only exists for cPanel & WHM version 11.52 and earlier.

ftp