summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2014-01-18 10:21:50 -0500
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2014-01-18 10:21:50 -0500
commit11ed8e87c3223d445c69921fbdd157062465f84b (patch)
tree74ef22d7d82bb147cc1d79c8e2afb18ef91ad47b
parent17044830822685134794409d5e8d701243ae3b32 (diff)
downloadpyopenssl-11ed8e87c3223d445c69921fbdd157062465f84b.tar.gz
Do the other initialization that is probably required.
-rw-r--r--OpenSSL/SSL.py14
-rw-r--r--OpenSSL/__init__.py3
-rw-r--r--OpenSSL/crypto.py3
3 files changed, 17 insertions, 3 deletions
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index 6ca8913..325d47c 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -1408,3 +1408,17 @@ class Connection(object):
_raise_current_error()
ConnectionType = Connection
+
+# There are no direct unit tests for this initialization. It is tested
+# indirectly since it is necessary for all proper error reporting (via
+# exception_from_error_queue).
+#
+# Thus OpenSSL.test.test_crypto.FunctionTests.test_dump_privatekey_passphrase
+# and some other similar tests may fail without this (though they may not if
+# the Python runtime has already done some initialization of the underlying
+# OpenSSL library (and is linked against the same one that cryptography is
+# using)).
+_lib.ERR_load_SSL_strings()
+
+# This is similar but exercised more by the Context initializer.
+_lib.SSL_library_init()
diff --git a/OpenSSL/__init__.py b/OpenSSL/__init__.py
index 396a97f..db96e1f 100644
--- a/OpenSSL/__init__.py
+++ b/OpenSSL/__init__.py
@@ -10,6 +10,3 @@ from OpenSSL.version import __version__
__all__ = [
'rand', 'crypto', 'SSL', 'tsafe', '__version__']
-
-
-# ERR_load_crypto_strings, SSL_library_init, ERR_load_SSL_strings
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index 0a9e8a2..7dc31c8 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -2290,3 +2290,6 @@ else:
# OpenSSL library (and is linked against the same one that cryptography is
# using)).
_lib.OpenSSL_add_all_algorithms()
+
+# This is similar but exercised mainly by exception_from_error_queue.
+_lib.ERR_load_crypto_strings()