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

[master] Do not use deprecated ssl.PROTOCOL_TLS #66767

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
3 changes: 2 additions & 1 deletion salt/transport/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,14 @@ def ssl_context(ssl_options, server_side=False):
backwards compatability older ssl config settings but adds verify_locations
and verify_flags options.
"""
default_version = ssl.PROTOCOL_TLS
if server_side:
default_version = ssl.PROTOCOL_TLS_SERVER
purpose = ssl.Purpose.CLIENT_AUTH
elif server_side is not None:
default_version = ssl.PROTOCOL_TLS_CLIENT
purpose = ssl.Purpose.SERVER_AUTH
else:
raise ValueError("server_side must be True or False")
# Use create_default_context to start with what Python considers resonably
# secure settings.
context = ssl.create_default_context(purpose)
Expand Down