Page tree
Skip to end of metadata
Go to start of metadata

Description

This function sets values for AutoSSL's metadata keys. This allows you to replace certificates that AutoSSL did not issue and toggle other AutoSSL notifications.

Note:

We recommend that you use the WHM API 1 function set_autossl_metadata_key instead.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/set_autossl_metadata?api.version=1&metadata_json=%7B%22clobber_externally_signed%22%3A1%7D%0A&metadata_json=%7B%22notify_autossl_expiry%22%3A1%7D%0A&metadata_json=%7B%22notify_autossl_expiry_coverage%22%3A1%7D%0A&metadata_json=%7B%22notify_autossl_renewal%22%3A1%7D%0A&metadata_json=%7B%22notify_autossl_renewal_coverage%22%3A1%7D%0A
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/set_autossl_metadata?api.version=1&metadata_json=%7B%22clobber_externally_signed%22%3A1%7D%0A&metadata_json=%7B%22notify_autossl_expiry%22%3A1%7D%0A&metadata_json=%7B%22notify_autossl_expiry_coverage%22%3A1%7D%0A&metadata_json=%7B%22notify_autossl_renewal%22%3A1%7D%0A&metadata_json=%7B%22notify_autossl_renewal_coverage%22%3A1%7D%0A
 Command Line
whmapi1 set_autossl_metadata metadata_json={\"clobber_externally_signed\":1} metadata_json={\"notify_autossl_expiry\":1} metadata_json={\"notify_autossl_expiry_coverage\":1} metadata_json={\"notify_autossl_renewal\":1} metadata_json={\"notify_autossl_renewal_coverage\":1}


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. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": "1",
        "command": "set_autossl_metadata"
    }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>set_autossl_metadata</command>
    </metadata>
</result>


Note:

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

Parameters

Note:

You can enter more than one metadata_json parameter to set multiple values.


ParameterTypeDescriptionPossible valuesExample
metadata_jsonJSON

Required

A JSON-encoded hash of metadata keys and values which control AutoSSL's behavior.

This hash contains the clobber_externally_signed, notify_autossl_expiry, notify_autossl_expiry_coverage, notify_autossl_renewal, and notify_autossl_renewal_coverage parameters.
{\"clobber_externally_signed\":1}

clobber_externally_signed

Boolean

This option will allow AutoSSL to replace certificates that the AutoSSL system did not issue. When you enable this option, AutoSSL will install certificates that replace users’ Certificate Authority (CA) issued certificates if they are invalid or expire within three days.

The function accepts this parameter in the metadata_json hash.

  • 1 — Replace the certificate.
  • 0 — Do not replace the certificate.
1

notify_autossl_expiry

Boolean

This option will send a notification when an AutoSSL certificate expires. This occurs when AutoSSL cannot request a new certificate.

The function accepts this parameter in the metadata_json hash.

Notes:

  • This can happen if all of a website’s domains fail domain control validation (DCV), or if the AutoSSL provider has not issued a certificate in response to a request.
  • We added this parameter in cPanel & WHM version 70.
  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_expiry_coverage

Boolean

This option will send a notification if at least one currently-secured domain will lose coverage when the certificate renews.

The function accepts this parameter in the metadata_json hash.

Note:

We added this parameter in cPanel & WHM version 70.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_renewal

Boolean

This option will send a notification if a certificate renewal succeeds.

The function accepts this parameter in the metadata_json hash.

Note:

We added this parameter in cPanel & WHM version 70.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_renewal_coverage

Boolean

This option will send a notification if a currently-secured domain fails DCV and the certificate has not reached its renewal period.

The function accepts this parameter in the metadata_json hash.

Note:

We added this parameter in cPanel & WHM version 70.

  • 1 — Notify.
  • 0 — Do not notify.
1

Returns

This function only returns metadata.