summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2014-01-18 10:31:51 -0500
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2014-01-18 10:31:51 -0500
commit87e525ac72a778301f478382afda8a11e3683f5e (patch)
tree265631f40940768575253db897576a087a7cf44e
parent684baf568794aa8d0da5537a454f681334baf227 (diff)
downloadpyopenssl-87e525ac72a778301f478382afda8a11e3683f5e.tar.gz
And use_privatekey_file
-rw-r--r--OpenSSL/SSL.py4
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")