Я передал свой SSL-сертификат pymsql следующим образом:
`conn = pymysql.connect(host='hostname', user='root', password='pass',ssl ={ 'cert':'client-cert.pem','key': 'client-key.pem','ca':'server-ca.pem'} )`
, но он выдает мне эту ошибку:
Traceback (most recent call last):
File "C:\Users\abhis\AppData\Local\Programs\Python\Python37\lib\site-
packages\pymysql\connections.py", line 599, in connect
self._request_authentication()
File "C:\Users\abhis\AppData\Local\Programs\Python\Python37\lib\site-
packages\pymysql\connections.py", line 803, in _request_authentication
self._sock = self.ctx.wrap_socket(self._sock, server_hostname=self.host)
File "C:\Users\abhis\AppData\Local\Programs\Python\Python37\lib\ssl.py",
line 412, in wrap_socket
session=session
File "C:\Users\abhis\AppData\Local\Programs\Python\Python37\lib\ssl.py",
line 853, in _create
self.do_handshake()
File "C:\Users\abhis\AppData\Local\Programs\Python\Python37\lib\ssl.py",
line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed: IP address mismatch, certificate is not valid for
'Hostname'. (_ssl.c:1056)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/PythonProject/test.py", line 3, in <module>
conn = pymysql.connect(host='hostname', user='root',
password='pass',ssl ={ 'cert':'client-cert.pem','key': 'client-
key.pem','ca':'server-ca.pem'} )
File "C:\Users\abhis\AppData\Local\Programs\Python\Python37\lib\site-
packages\pymysql\__init__.py", line 94, in Connect
return Connection(*args, **kwargs)
File "C:\Users\abhis\AppData\Local\Programs\Python\Python37\lib\site-
packages\pymysql\connections.py", line 325, in __init__
self.connect()
File "C:\Users\abhis\AppData\Local\Programs\Python\Python37\lib\site-
packages\pymysql\connections.py", line 630, in connect
raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on
'Hostname' ([SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: IP
address mismatch, certificate is not valid for 'Hostname'.
(_ssl.c:1056))")
Я хочу передать SSL-сертификат, чтобыЯ могу подключиться к базе данных безопасным способом