probetls

verify_certificate

Performs a range of checks on the certificate of a remote endpoint

Activity as code

Below are the details and signature of the activity Python module.

Typeprobe
Modulechaosreliably.activities.tls.probes
Nameverify_certificate
Returnbool

Usage

JSON

{
  "name": "resolve-dns-name",
  "type": "probe",
  "provider": {
    "type": "python",
    "module": "chaosreliably.activities.tls.probes",
    "func": "verify_certificate",
    "arguments": {
      "host": "",
      "port": 443
    }
  }
}

YAML

name: resolve-dns-name
type: probe
provider:
  func: verify_certificate
  module: chaosreliably.activities.tls.probes
  type: python
  arguments:
    host: ""
    port: 443

Arguments

NameTypeDefaultRequiredTitleDescription
hoststringYesHostA reachable host presenting a certificate
portinteger443YesPortPort to connect to be served the certificate on the host
expire_afterstring“7d”NoExpires AfterThreshold below which the verification should fail because it’s close to the expiry date of the certificate
alt_nameslistnullNoAlternative NamesList of alternative names supported by this certificate

Performs a range of checks on the certificate of the remote endpoint:

* that we are beyond a certain duration of the certificate expiricy date
* that the certificate exports the right alternative names

If any of these values is not set (the default), the according
check is not performed. This doesn't apply to the expiration date which
is always checked.

Signature

def verify_certificate(
    host: str,
    port: int = 443,
    expire_after: str = "7d",
    alt_names: Optional[List[str]] = None,
) -> bool:
    pass