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