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
| Attribute | Type | Description |
|---|---|---|
| name | str = "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
| Name | Type | Description |
|---|---|---|
| value | t.Any | The value to convert, which can be a file path, 'adhoc', or an import string for an SSLContext object. |
| param | `click.Parameter | None` |
| ctx | `click.Context | None` |
Returns
| Type | Description |
|---|---|
t.Any | The converted value, which can be a file path string, the string 'adhoc', or an ssl.SSLContext object. |