-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add SSL tunnel connection mode #44
Comments
Generally, the approach of post-processing |
It seems a good PR to have. About the proof of concept, that would be a good base for a PR. Some remarks :
|
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Google Cloud SQL uses a pre-existing SSL tunnel to connect to MySQL. In the past, Spring Cloud GCP and Google Cloud Socket Factory relied on the 3rd party MySQL driver, but with Spring Boot 2.7 recommending to use the MariaDB driver, we started looking into the integration (GoogleCloudPlatform/cloud-sql-jdbc-socket-factory#990).
Because of the need to use a pre-existing SSL tunnel, some changes are needed in this driver:
SslContextBuilder
, injecting the correct key/trust managers on demand, based on an ephemeral certificate retrieved from the backend.MariadbConnectionConfiguration
needs to accept this as an option, andSslConfig
needs to call the customizer to get the correct SSL configuration.SslMode
.AuthenticationFlow
because the initial server-side handshake needs to be received over an already-established SSL tunnel, and not in plain-text. I added the SSL context establishment intoSimpleClient
constructor, but that seems inelegant. I'd love advice for a better place to add this logic.Would this be an acceptable approach? I have a working proof of concept that I could turn into a pull request.
FYI @mp911de.
The text was updated successfully, but these errors were encountered: