From 9cfad4cdb4fcec787114f0a9cb36afac274722fd Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Tue, 26 Nov 2024 12:20:12 +0100 Subject: [PATCH] Small cleanup (#275) * Small cleanup. --- mocket/ssl/socket.py | 5 +++-- mocket/utils.py | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mocket/ssl/socket.py b/mocket/ssl/socket.py index f7f41761..6dcd7817 100644 --- a/mocket/ssl/socket.py +++ b/mocket/ssl/socket.py @@ -2,6 +2,7 @@ import ssl from datetime import datetime, timedelta +from ssl import Options from typing import Any from mocket.compat import encode_to_bytes @@ -53,9 +54,9 @@ def getpeercert(self, binary_form: bool = False) -> _PeerCertRetDictType: } def ciper(self) -> tuple[str, str, str]: - return ("ADH", "AES256", "SHA") + return "ADH", "AES256", "SHA" - def compression(self) -> str | None: + def compression(self) -> Options: return ssl.OP_NO_COMPRESSION def unwrap(self) -> MocketSocket: diff --git a/mocket/utils.py b/mocket/utils.py index 31557a58..ab293776 100644 --- a/mocket/utils.py +++ b/mocket/utils.py @@ -1,13 +1,10 @@ from __future__ import annotations import binascii -import ssl from typing import Callable from mocket.compat import decode_from_bytes, encode_to_bytes -SSL_PROTOCOL = ssl.PROTOCOL_TLSv1_2 - def hexdump(binary_string: bytes) -> str: r""" @@ -42,7 +39,6 @@ def get_mocketize(wrapper_: Callable) -> Callable: __all__ = ( - "SSL_PROTOCOL", "get_mocketize", "hexdump", "hexload",