connector-x icon indicating copy to clipboard operation
connector-x copied to clipboard

Add SSL certificate support for mysql

Open wangxiaoying opened this issue 3 years ago • 8 comments

Add SSL certificate support for mysql

wangxiaoying avatar Sep 05 '22 21:09 wangxiaoying

I'd be interested in this feature.

DanteOz avatar Dec 27 '22 01:12 DanteOz

Just wanted to register interest in this, and share what I found while researching this.

The upstream crate does seem to have SSL support. While reading #104 to figure out what would need to change, I noticed a review comment saying that native-tls is preferred. Fortunately the upstream crate supports that as well.

There's also an example in the docs of how to use SSL, although I can't quite get it to work with strict SSL certificate checking. (I had to change with_root_cert_path to with_root_ca_path to get it to work, so the docs may not be quite up to date.)

My own reason for interest in this is the Polars library, which requires connector-x to load data from SQL. Without SSL support, the fastest way to get data into Polars is to use Pandas with SQLAlchemy to load the data, which you can imagine is not fast.

nickodell avatar Jan 22 '23 07:01 nickodell

Hi, I'm in the process of migrating my calls to pd.read_sql_query to cx.read_sql for performance improvements. However, my company mandates using SSL by specifying ssl-mode=preferred in the connection string. To my understanding, SSL is currently not supported for MySQL, when specifying in the connection string: mysql://username:password@server:port/schema?sslmode=preferred

I encounter the following error:

RuntimeError: Unknown URL parameter `sslmode'

I have also tried other variants such as ssl-mode, sslMode etc.

Is there any ETA for this feature? Thanks for the great work by the way!

silex-thomas avatar Mar 13 '23 15:03 silex-thomas

By the way, my company would potentially be interested in sponsoring work on this feature. We have a MySQL server with SSL, and it would benefit from using connector-x. Would funding be helpful?

@silex-thomas Are you in a similar position to me? Would your company also be interested in sponsoring this?

nickodell avatar Jul 16 '23 04:07 nickodell