Skip to content

Commit

Permalink
Merge pull request #475 from TeskaLabs/feature/rename-tls-password
Browse files Browse the repository at this point in the history
Rename TLS password config option to avoid name conflicts
  • Loading branch information
byewokko authored Aug 14, 2023
2 parents 1de49bc + 81e27c0 commit 5dc03d1
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 5dc03d1

Please sign in to comment.