diff options
author | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2014-01-18 10:31:51 -0500 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2014-01-18 10:31:51 -0500 |
commit | 87e525ac72a778301f478382afda8a11e3683f5e (patch) | |
tree | 265631f40940768575253db897576a087a7cf44e | |
parent | 684baf568794aa8d0da5537a454f681334baf227 (diff) | |
download | pyopenssl-87e525ac72a778301f478382afda8a11e3683f5e.tar.gz |
And use_privatekey_file
-rw-r--r-- | OpenSSL/SSL.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py index 990a370..3570ffb 100644 --- a/OpenSSL/SSL.py +++ b/OpenSSL/SSL.py @@ -441,6 +441,10 @@ class Context(object): :param filetype: (optional) The encoding of the file, default is PEM :return: None """ + if isinstance(keyfile, _text_type): + # Perhaps sys.getfilesystemencoding() could be better? + keyfile = keyfile.encode("utf-8") + if not isinstance(keyfile, bytes): raise TypeError("keyfile must be a byte string") |