diff --git a/stubs/pyOpenSSL/OpenSSL/SSL.pyi b/stubs/pyOpenSSL/OpenSSL/SSL.pyi index 792795eaf..8857e80a4 100644 --- a/stubs/pyOpenSSL/OpenSSL/SSL.pyi +++ b/stubs/pyOpenSSL/OpenSSL/SSL.pyi @@ -1,6 +1,6 @@ import socket from collections.abc import Callable, Sequence -from typing import Any +from typing import Any, TypeVar from OpenSSL.crypto import X509, PKey @@ -135,6 +135,8 @@ class Connection: def get_app_data(self) -> Any: ... def set_app_data(self, data: Any) -> None: ... +_T = TypeVar("_T") + class Context: def __getattr__(self, name: str) -> Any: ... # incomplete def __init__(self, method: int) -> None: ... @@ -153,9 +155,7 @@ class Context: def set_keylog_callback(self, callback: Callable[[Connection, bytes], object]) -> None: ... def set_alpn_protos(self, protos: Sequence[bytes]) -> None: ... def set_alpn_select_callback(self, callback: Callable[[Connection, list[bytes]], bytes]) -> None: ... - def set_ocsp_server_callback( - self, callback: Callable[[Connection, bytes | None], bytes], data: bytes | None = ... - ) -> None: ... + def set_ocsp_server_callback(self, callback: Callable[[Connection, _T | None], bytes], data: _T | None = ...) -> None: ... def set_ocsp_client_callback( - self, callback: Callable[[Connection, bytes, bytes | None], bool], data: bytes | None = ... + self, callback: Callable[[Connection, bytes, _T | None], bool], data: _T | None = ... ) -> None: ...