duck.utils.ssl¶
SSL related tools and utilities.
Module Contents¶
Functions¶
Generates a key pair (Key), csr (Certificate Signing Request ) and a self-signed certificate (CRT) for server-side use. |
|
Checks if the given data is an SSL/TLS record. |
API¶
- duck.utils.ssl.generate_server_cert()¶
Generates a key pair (Key), csr (Certificate Signing Request ) and a self-signed certificate (CRT) for server-side use.
This will generate 3 files using openssl: server.csr server.key server.crt
This uses variables set in settings.py
- duck.utils.ssl.is_ssl_data(data: bytes) bool¶
Checks if the given data is an SSL/TLS record.
- Parameters:
data – Raw bytes received from a socket.
- Returns:
True if data appears to be SSL/TLS, False otherwise.
- Return type:
bool