@@ -29,19 +29,19 @@ def __init__(self, host='localhost', port=9200, http_auth=None,
29
29
headers .setdefault ('content-type' , 'application/json' )
30
30
31
31
# if providing an SSL context, raise error if any other SSL related flag is used
32
- if ssl_context and (verify_certs or ca_certs or ssl_version ):
33
- raise ImproperlyConfigured ("When using `ssl_context`, `use_ssl`, `verify_certs`, `ca_certs` and `ssl_version` are not permitted" )
32
+ if ssl_context and (verify_certs or ca_certs ):
33
+ raise ImproperlyConfigured ("When using `ssl_context`, `use_ssl`, `verify_certs`, `ca_certs` are not permitted" )
34
34
35
35
if use_ssl or ssl_context :
36
- cafile = CA_CERTS if ca_certs is None else ca_certs
36
+ cafile = ca_certs
37
37
if not cafile and not ssl_context and verify_certs :
38
38
# If no ca_certs and no sslcontext passed and asking to verify certs
39
39
# raise error
40
40
raise ImproperlyConfigured ("Root certificates are missing for certificate "
41
41
"validation. Either pass them in using the ca_certs parameter or "
42
42
"install certifi to use it automatically." )
43
- if verify_certs or ca_certs or ssl_version :
44
- warnings .warn ('Use of `verify_certs`, `ca_certs`, `ssl_version` have been deprecated in favor of using SSLContext`' , DeprecationWarning )
43
+ if verify_certs or ca_certs :
44
+ warnings .warn ('Use of `verify_certs`, `ca_certs` have been deprecated in favor of using SSLContext`' , DeprecationWarning )
45
45
46
46
if not ssl_context :
47
47
# if SSLContext hasn't been passed in, create one.
@@ -56,6 +56,9 @@ def __init__(self, host='localhost', port=9200, http_auth=None,
56
56
ssl_context .verify_mode = ssl .CERT_NONE
57
57
warnings .warn (
58
58
'Connecting to %s using SSL with verify_certs=False is insecure.' % host )
59
+ if ssl_context :
60
+ verify_certs = True
61
+ use_ssl = True
59
62
60
63
self .session = aiohttp .ClientSession (
61
64
auth = http_auth ,
0 commit comments