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

Rename TLS password config option to avoid name conflicts #475

Merged
merged 1 commit into from
Aug 14, 2023
Merged
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
10 changes: 5 additions & 5 deletions asab/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SSLContextBuilder(Configurable):
ConfigDefaults = {
'cert': '', # The certfile string must be the path to a PEM file containing the certificate as well as any number of CA certificates needed to establish the certificate’s authenticity.
'key': '', # The keyfile string, if present, must point to a file containing the private key in. Otherwise the private key will be taken from certfile as well.
'password': '',
'key_password': '',

# Following three options are fed into SSLContext.load_verify_locations(...)
'cafile': '',
Expand Down Expand Up @@ -55,16 +55,16 @@ def build(self, protocol=ssl.PROTOCOL_TLS) -> ssl.SSLContext:
if len(keyfile) == 0:
keyfile = None

password = self.Config.get("password")
if len(password) == 0:
password = None
key_password = self.Config.get("key_password")
if len(key_password) == 0:
key_password = None

cert = self.Config.get("cert")
if len(cert) != 0:
ctx.load_cert_chain(
cert,
keyfile=keyfile,
password=password,
password=key_password,
)

cafile = self.Config.get("cafile")
Expand Down