Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to disable TLS verification when using mariadb-connector-c >= 3.4.0 #1379

Open
jpalermo opened this issue Oct 8, 2024 · 1 comment

Comments

@jpalermo
Copy link

jpalermo commented Oct 8, 2024

Mariadb connector c release notes for 3.4.0 mention enable MYSQL_OPT_SSL_VERIFY_SERVER_CERT by default.

Using mysql2 with that connector does not allow connecting to a server without using TLS. Setting ssl_mode to disabled seems to do nothing.

irb(main):005:0> client = Mysql2::Client.new(:host => "HOST", :username => "USERNAME", :password => 'PASSWORD', :ssl_mode => :disabled)
gem_home/ruby/3.2.0/gems/mysql2-0.5.6/lib/mysql2/client.rb:97:in `connect': TLS/SSL error: Certificate verification failure: The certificate is NOT trusted. (Mysql2::Error::ConnectionError)

irb(main):012:0> Mysql2::Client.info
=> {:id=>30401, :version=>"3.4.1", :header_version=>"10.8.8"}
@jpalermo
Copy link
Author

If anybody else is running into this issue, we couldn't figure out where the disconnect is between the mysql2 code and the mariadb-connector-c library. It all seems like it's setting the correct flags, but for some reason it refuses to disable TLS.

We worked around it by compiling the mariadb-connector-c with the -DDEFAULT_SSL_VERIFY_SERVER_CERT=0 which defaults it to the old behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant