TLS 1.2

100 views
Skip to first unread message

Patrick Bruce

unread,
Mar 27, 2023, 2:39:21 PM3/27/23
to sqlalchemy
I am connecting to a MySQL db using sqlalchemy and TLS 1.2 is enforced server side. I connect by setting my URI to the correct connection string and adding the ?ssl=true flag at the end. However I am getting an error that the TLS version does not meet the minimum requirements of the server. My question is how to force sqlalchemy to connect using TLS 1.2?

App env: Python 3.6 using Flask 

Jonathan Vanasco

unread,
Mar 28, 2023, 1:18:57 PM3/28/23
to sqlalchemy
Many users with similar experiences ultimately traced the issue to an outdated database driver.

I would try updating your driver.  If that does not work, please share the driver + version, and your connection string / code.

Mike Bayer

unread,
Mar 29, 2023, 1:56:14 AM3/29/23
to noreply-spamdigest via sqlalchemy
this is a driver issue so you'd need to get specifics from the driver you're using, such as mysqlclient or pymysql.


create_engine("mysql+mysqldb://...?ssl=true", connect_args={"ssl": {"tls_version": "1.2"}})




On Mon, Mar 27, 2023, at 2:39 PM, Patrick Bruce wrote:
I am connecting to a MySQL db using sqlalchemy and TLS 1.2 is enforced server side. I connect by setting my URI to the correct connection string and adding the ?ssl=true flag at the end. However I am getting an error that the TLS version does not meet the minimum requirements of the server. My question is how to force sqlalchemy to connect using TLS 1.2?

App env: Python 3.6 using Flask 


--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
 
 
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages