def _make_context(self, to_add_ca_cert_path): if HAS_URLLIB3_PYOPENSSLCONTEXT: context = PyOpenSSLContext(PROTOCOL) else: context = create_default_context() if to_add_ca_cert_path: context.load_verify_locations(to_add_ca_cert_path) return context
def _make_context(self, to_add_ca_cert_path): if HAS_URLLIB3_PYOPENSSLCONTEXT: context = PyOpenSSLContext(PROTOCOL) else: context = create_default_context() if to_add_ca_cert_path: context.load_verify_locations(to_add_ca_cert_path) return context
def _make_context(self, to_add_ca_cert_path): if HAS_SSLCONTEXT: context = create_default_context() elif HAS_URLLIB3_PYOPENSSLCONTEXT: context = PyOpenSSLContext(PROTOCOL) else: raise NotImplementedError('Host libraries are too old to support creating an sslcontext') if to_add_ca_cert_path: context.load_verify_locations(to_add_ca_cert_path) return context
def _make_context(self, to_add_ca_cert_path): if HAS_SSLCONTEXT: context = create_default_context() elif HAS_URLLIB3_PYOPENSSLCONTEXT: context = PyOpenSSLContext(PROTOCOL) else: raise NotImplementedError('Host libraries are too old to support creating an sslcontext') if to_add_ca_cert_path: context.load_verify_locations(to_add_ca_cert_path) return context