eclipse-vertx / vertx-sql-client

High performance reactive SQL Client written in Java
Apache License 2.0
894 stars 200 forks source link

Don't disable hostname verification for SQL clients unconditionally #1426

Closed Traderjoe95 closed 8 months ago

Traderjoe95 commented 8 months ago

Motivation:

Hostname verification is unconditionally disabled for all SQL clients using ConnectionFactoryBase. This makes PG and MySQL clients incorrectly accept certificates that do not contain the expected hostname when the SSL mode is set to VERIFY_FULL or VERIFY_IDENTITY, respectively.

This PR fixes the bugs and adds tests for the correct behavior. The test server certificate for MySQL is also updated, as the previous one has a CN that's not a valid host name. The certificate is replaced with a new one using the same key, but with CN=mysql.vertx.test as the subject DN.

Fixes #1419