Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssl: Implement SSLSession support. #829

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ssl: Implement SSLSession support.
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
  • Loading branch information
DvdGiessen committed Oct 24, 2024
commit dd4fc8aaa669fe6b0735461e6978e3190720d4ef
5 changes: 4 additions & 1 deletion python-stdlib/ssl/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ def load_verify_locations(self, cafile=None, cadata=None):
self._context.load_verify_locations(cadata)

def wrap_socket(
self, sock, server_side=False, do_handshake_on_connect=True, server_hostname=None
self, sock, server_side=False, do_handshake_on_connect=True, server_hostname=None, session=None,
):
return self._context.wrap_socket(
sock,
server_side=server_side,
do_handshake_on_connect=do_handshake_on_connect,
server_hostname=server_hostname,
session=session,
)


Expand All @@ -50,6 +51,7 @@ def wrap_socket(
cadata=None,
server_hostname=None,
do_handshake=True,
session=None,
):
con = SSLContext(PROTOCOL_TLS_SERVER if server_side else PROTOCOL_TLS_CLIENT)
if cert or key:
Expand All @@ -62,4 +64,5 @@ def wrap_socket(
server_side=server_side,
do_handshake_on_connect=do_handshake,
server_hostname=server_hostname,
session=session,
)
Loading