Child pages
  • cPanel API 1 Functions - SSL::gencrt
Skip to end of metadata
Go to start of metadata

Description

This function generates a self-signed certificate for a domain.

Warning:

cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:

Examples 


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$new_crt = $cpanel->api1('SSL','gencrt', array('example.com','us','Texas','Houston','The Example Company','The Widget Division','user@example.com') ); // Call the function.


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.
my $new_crt = $cpliveapi->api1('SSL','gencrt', ['example.com','us','Texas','Houston','The Example Company','The Widget Division','user@example.com'] ); # Call the function.


Note:

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

 

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="SSL::gencrt( $FORM('host','country','state','city','company','companydivision','email') )">
 Command Line
cpapi1 --user=username SSL gencrt example.com us Texas Houston "The Example Company" "The Widget Division" user@example.com


Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command. 

 Output (plaintext)
Certificate generated!

Parameters

ParameterTypeDescriptionPossible valuesExample
host

string

Required

The domain name.

A valid domain name.example.com
countrystring

Required

The certificate owner's country.

A valid two-letter ISO-3166 country code.US
statestring

Required

The certificate owner's state.

A valid state name.

Note:

Do not abbreviate this parameter. Use the full name of the state.

Texas
citystring

Required

The certificate owner's city.

A valid string.Houston
companystring

Required

The certificate owner's company.

A valid string.The Example Company
companydivisionstring

The division of the company that owns the certificate.

This parameter defaults to an empty string.

A valid string.The Widget Division
emailstring

Required

The email address of the certificate owner.

A valid email address.user@example.com

Returns

This function returns a confirmation message.