[% USE CPIcons; USE CPList; USE SSL; USE JSON; USE Geo; USE CPScalar; # CONSTANTS SET SHOW_HELPER_LINKS_RECORD_COUNT = 10; SET MINIMUM_MODULUS_LENGTH = SSL.DEFAULT_KEY_SIZE; SET CPANEL.CPVAR.dprefix = '../'; SET SYSTEM_DEFAULT_KEY_TYPE = SSL.key_types_and_labels().0; SET DEFAULT_NEW_KEY_TYPE = SSL.default_key_type() || SYSTEM_DEFAULT_KEY_TYPE.type; SET DEFAULT_NEW_KEY_LABEL = ""; FOREACH key_type = SSL.key_types_and_labels(); IF DEFAULT_NEW_KEY_TYPE == key_type.type; DEFAULT_NEW_KEY_LABEL = key_type.label; END; END; # Fetch the certificates for this user SET list_certs = execute('SSL', 'list_certs', { 'api.sort_column' => 'subject.commonName', } ); SET expiration_times = list_certs.data.ofeach('not_after'); IF expiration_times && expiration_times.size() > 0; FOR exp_time = expiration_times; expiration_times.${loop.index} = exp_time + 1; END; SET expiration_date = locale.get_lookup_hash_of_multi_epoch_datetime( expiration_times, 'date_format_short' ); SET expiration_datetime = locale.get_lookup_hash_of_multi_epoch_datetime( expiration_times, 'datetime_format_short' ); ELSE; SET expiration_date = 0; SET expiration_datetime = 0; END; # Fetch the keys for this user. SET list_keys = execute('SSL', 'list_keys', { 'api.sort_column' => 'friendly_name', } ); SET has_certs_error = !list_certs.status; SET has_certs_data = !has_certs_error && list_certs.data.size; SET list_count = list_certs.data ? list_certs.data.size() : 0; #Domains SET list_mail_domains = execute('WebVhosts','list_domains', { 'api.sort_column' => 'domain', }); %] [% js_code = PROCESS js_block %] [% WRAPPER '_assets/master.html.tt' app_key = 'ssl_tls' include_legacy_scripts = 1 include_cjt = 1 page_js = js_code embed_stylesheets = ["css/ssl.css"] page_stylesheets = ["css2-min/ssl/crts.css"] -%] [% PROCESS _assets/_ajaxapp_header.html.tt -%]
[% locale.maketext('You can use a self-signed certificate or a trusted certificate from an SSL Certificate Authority. If you plan to use a self-signed certificate for one of your sites, you can generate it below. To use a trusted certificate, upload or provide the certificate below, after you have received the SSL certificate from your trusted provider.') %]
| [% locale.maketext('Domains') %] | [% locale.maketext('Issuer') %] | [% locale.maketext('Expiration ([_1])','UTC') %] | [% locale.maketext('Key Type') %] | [% locale.maketext('Description') %] | [% locale.maketext("Actions") %] |
|---|---|---|---|---|---|
[% cert.domains.join("\n").html().breakOn('\.').replace("\n",' ') %] |
[% issuer.html().breakOn('\.') %] |
[% expiration_date.${cert_expiration} %] |
[% SSL.translate_key_parts_to_label(cert) %] [% IF modulus_error %] [% error_icon %] [% END %] | [% cert.friendly_name.html().breakOn('\.') %] |
[% locale.maketext('Edit') %] [% locale.maketext("Delete") %] [% IF inactive_reason -%] [% locale.maketext("Install") -%] [% ELSE -%] [% locale.maketext("Install") %] [% END -%] |
| [% locale.maketext("There are no certificates on the server.") %] | |||||
[% locale.maketext("Use this form to upload a certificate provided by a third-party Certificate Authority. You may either paste the body of the certificate or upload it from a “[_1]” file.", ".crt") %]
[% locale.maketext('Use this form to generate a new, self-signed certificate for your domain. Typically, self-signed certificates are temporarily used until you receive a trusted SSL certificate from your SSL certificate authority.') %]