mysql2
mysql2 copied to clipboard
CA verification not respected when `ssl_mode` flag is passed
Prerequisites:
- MYSQL2 GEM is linked against MariaDB Connector/C 3.0.2
Issue:
When trying to establish a connection as below, even when giving an incorrect CA that did not sign the server certificate, a connection is established successfully:
:ssl_mode => "verify_ca", :sslca => "path-to-incorrect-ca"
Any reason why this could be happening ?
The MariaDB Connector doesn't support :ssl_mode / partial validation; so, the CA is just ignored without the :verifyssl flag.
There's a warning for MySQL < 5.7.11 that :ssl_mode
is only partially supported. Should there be an equivalent warning for certain versions of MariaDB? All versions of MariaDB?
Answering my own question by linking to https://github.com/brianmario/mysql2/issues/879#issuecomment-437951093