From ab47cd8cc436848b04a61824fa8f01d61bd8fb4f Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Tue, 26 Nov 2024 12:12:43 +0100 Subject: [PATCH 1/2] Small cleanup. --- mocket/utils.py | 4 ---- 1 file changed, 4 deletions(-) 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", From 008ef960316bd92a415624f9478b072be21f2e76 Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Tue, 26 Nov 2024 12:16:35 +0100 Subject: [PATCH 2/2] Small cleanup. --- mocket/ssl/socket.py | 5 +++-- 1 file changed, 3 insertions(+), 2 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: