Merge "Use the same ssl module httpx uses"
diff --git a/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py b/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py
index 2e1464c..3c92181 100644
--- a/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py
+++ b/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py
@@ -1256,7 +1256,18 @@
const.ACTIVE,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout)
-
+ # TODO(johnsom) - Remove this once eventlet is removed from OpenStack
+ # NOTE(pas-ha): depending on what other tempest plugins are installed
+ # the eventlet might've been imported by that time, and, since
+ # dnspython 2.2.0, importing eventlet or any part of it effectively
+ # instantiates a dummy httpx.Client instance, thus pinning the ssl
+ # implementation in httpx to the eventlet's one.
+ # This leads to error in the Client() call below, as the ssl lib in
+ # this module is different from ssl lib in httpx._config,
+ # which fails isinstance check for ssl.SSLContext.
+ # Use the ssl module that is actually used by httpx to instantiate
+ # the SSL context to be used with httpx.
+ ssl = httpx._config.ssl
context = ssl.create_default_context(cadata=self.ca_cert.public_bytes(
serialization.Encoding.PEM).decode('utf-8'))
context.check_hostname = False