Skip to main content

CertParamType

Click option type for the --cert option. Allows either an existing file, the string 'adhoc', or an import for a :class:~ssl.SSLContext object.

Attributes

AttributeTypeDescription
namestr = "path"This attribute stores the name of the parameter type, which is used by Click to identify the type in error messages and help text.

Constructor

Signature

def CertParamType() - > None

Methods


convert()

@classmethod
def convert(
value: t.Any,
param: click.Parameter | None,
ctx: click.Context | None
) - > t.Any

Converts the input value into a certificate type suitable for SSLContext. It accepts a file path to an existing certificate, the string 'adhoc' to generate an ad-hoc certificate, or an import string for an ssl.SSLContext object.

Parameters

NameTypeDescription
valuet.AnyThe value to convert, which can be a file path, 'adhoc', or an import string for an SSLContext object.
param`click.ParameterNone`
ctx`click.ContextNone`

Returns

TypeDescription
t.AnyThe converted value, which can be a file path string, the string 'adhoc', or an ssl.SSLContext object.