commit | 87e525ac72a778301f478382afda8a11e3683f5e | [log] [tgz] |
---|---|---|
author | Jean-Paul Calderone <exarkun@twistedmatrix.com> | Sat Jan 18 10:31:51 2014 -0500 |
committer | Jean-Paul Calderone <exarkun@twistedmatrix.com> | Sat Jan 18 10:31:51 2014 -0500 |
tree | 265631f40940768575253db897576a087a7cf44e | |
parent | 684baf568794aa8d0da5537a454f681334baf227 [diff] |
And use_privatekey_file
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 @@ :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")