Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
kukushking committed Apr 19, 2021
1 parent f06928e commit 49c1839
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pymysql/connections.py
Expand Up @@ -286,8 +286,6 @@ def _config(key, arg):
ssl["ca"] = ssl_ca
elif ssl_cadata is not None:
ssl["cadata"] = ssl_cadata
else:
raise ValueError("ssl_ca or ssl_catada must be provided")
if ssl_cert is not None:
ssl["cert"] = ssl_cert
if ssl_key is not None:
Expand Down Expand Up @@ -380,7 +378,7 @@ def _create_ssl_ctx(self, sslp):
ca = sslp.get("ca")
cadata = sslp.get("cadata")
capath = sslp.get("capath")
hasnoca = (ca is None or cadata is None) and capath is None
hasnoca = ca is None and cadata is None and capath is None
ctx = ssl.create_default_context(cafile=ca, capath=capath, cadata=cadata)
ctx.check_hostname = not hasnoca and sslp.get("check_hostname", True)
verify_mode_value = sslp.get("verify_mode")
Expand Down

0 comments on commit 49c1839

Please sign in to comment.