Closed vacquah closed 4 years ago
See the documentation for DBInterface.connect
for MySQL connections: https://juliadatabases.github.io/MySQL.jl/dev/#DBInterface.connect.
My apologies @quinnj. I read through that documentation and didnt quite understand it. There are no examples of how to specify ssl enforcement - it simply says ssl_enforce:::bool. I tried ssl_enforce = true, and it didnt work. I am quite new at all this so hoping you'd point me to an example code.
if I do ssl_enforce == true, I get:
MethodError: no method matching pointer(::Bool)
Closest candidates are:
pointer(!Matched::String) at strings/string.jl:81
pointer(!Matched::String, !Matched::Integer) at strings/string.jl:82
pointer(!Matched::SubString{String}) at strings/substring.jl:113
...
I'm not super familiar w/ how SSL works for MySQL client-side, but you can checkout the documentation here: https://dev.mysql.com/doc/refman/8.0/en/mysql-options.html for my info. In particular, checkout the MYSQL_OPT_SSL_*
options; I think you probably need to pass your private key ssl file and that should do it?
I actually just need to set ssl_enforce, I think. When using a regular desktop client to connect to the same db, I dont need to pass the private key. I just set sslmode=require.
I see you have ssl_enforce as part of the parameters I can pass in the connection string but I am not sure how that should be set . I have tried all values and still not working.
Ah, thanks for telling me about the error; I've pushed a fix for that here: https://github.com/JuliaDatabases/MySQL.jl/commit/340a4f1142a2346b169fca05ea92fad4309c6023. If you pull master of MySQL, then you should be able to try ssl_enforce=true
. You can pull master by doing ] add MySQL#master
@quinnj happy to report its working! your timely help is much appreciated! There seems to be the same issue with the LibPQ package when connecting to a postgres db.
How do you handle when ssl is required for DBInterface.connect ? I am getting an access denied message when trying to connect to a mysql database. I am able to connect to the same database with my database client (datagrip) by setting useSSL = "TRUE" in the clients configuration. Not sure how to set the same here ...