TLS Certificates#

Do not construct this object directly, instead access the tls_certificates property of an ngrok.Client object.

class ngrok.services.TLSCertificatesClient(client)[source]#

TLS Certificates are pairs of x509 certificates and their matching private key that can be used to terminate TLS traffic. TLS certificates are unused until they are attached to a Domain. TLS Certificates may also be provisioned by ngrok automatically for domains on which you have enabled automated certificate provisioning.

create(certificate_pem, private_key_pem, description='', metadata='')[source]#

Upload a new TLS certificate

Parameters:
  • description (str) – human-readable description of this TLS certificate. optional, max 255 bytes.

  • metadata (str) – arbitrary user-defined machine-readable data of this TLS certificate. optional, max 4096 bytes.

  • certificate_pem (str) – chain of PEM-encoded certificates, leaf first. See Certificate Bundles.

  • private_key_pem (str) – private key for the TLS certificate, PEM-encoded. See Private Keys.

https://ngrok.com/docs/api#api-tls-certificates-create

Return type:

TLSCertificate

delete(id)[source]#

Delete a TLS certificate

Parameters:

id (str) – a resource identifier

https://ngrok.com/docs/api#api-tls-certificates-delete

get(id)[source]#

Get detailed information about a TLS certificate

Parameters:

id (str) – a resource identifier

https://ngrok.com/docs/api#api-tls-certificates-get

Return type:

TLSCertificate

list(before_id=None, limit=None)[source]#

List all TLS certificates on this account

Parameters:
  • before_id (Optional[str, None]) –

  • limit (Optional[str, None]) –

https://ngrok.com/docs/api#api-tls-certificates-list

Return type:

TLSCertificateList

update(id, description=None, metadata=None)[source]#

Update attributes of a TLS Certificate by ID

Parameters:
  • id (str) –

  • description (Optional[str, None]) – human-readable description of this TLS certificate. optional, max 255 bytes.

  • metadata (Optional[str, None]) – arbitrary user-defined machine-readable data of this TLS certificate. optional, max 4096 bytes.

https://ngrok.com/docs/api#api-tls-certificates-update

Return type:

TLSCertificate