From a9d644b3ffd9e9a8bb9a01393674972573cd256b Mon Sep 17 00:00:00 2001
From: layday <layday@protonmail.com>
Date: Fri, 5 Apr 2024 21:29:11 +0300
Subject: [PATCH] Add `get_verified_chain` and `get_unverified_chain` for
 Python 3.13 (#11724)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
 stdlib/ssl.pyi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/stdlib/ssl.pyi b/stdlib/ssl.pyi
index b2263df1337d..15d86372531a 100644
--- a/stdlib/ssl.pyi
+++ b/stdlib/ssl.pyi
@@ -366,6 +366,9 @@ class SSLSocket(socket.socket):
     def recvmsg(self, *args: Never, **kwargs: Never) -> Never: ...  # type: ignore[override]
     def recvmsg_into(self, *args: Never, **kwargs: Never) -> Never: ...  # type: ignore[override]
     def sendmsg(self, *args: Never, **kwargs: Never) -> Never: ...  # type: ignore[override]
+    if sys.version_info >= (3, 13):
+        def get_verified_chain(self) -> list[bytes]: ...
+        def get_unverified_chain(self) -> list[bytes]: ...
 
 class TLSVersion(enum.IntEnum):
     MINIMUM_SUPPORTED: int
@@ -476,6 +479,9 @@ class SSLObject:
     def version(self) -> str | None: ...
     def get_channel_binding(self, cb_type: str = "tls-unique") -> bytes | None: ...
     def verify_client_post_handshake(self) -> None: ...
+    if sys.version_info >= (3, 13):
+        def get_verified_chain(self) -> list[bytes]: ...
+        def get_unverified_chain(self) -> list[bytes]: ...
 
 @final
 class MemoryBIO: