Skip to content

Porting of "Zero config TLS" MariaDB feature support from mysql-simple - #403

Open
lawrinn wants to merge 1 commit into
blackbeam:masterfrom
lawrinn:zero_config_tls
Open

Porting of "Zero config TLS" MariaDB feature support from mysql-simple#403
lawrinn wants to merge 1 commit into
blackbeam:masterfrom
lawrinn:zero_config_tls

Conversation

@lawrinn

@lawrinn lawrinn commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

It's based on auth plugins design change in mysql_common 0.38.0 - considers all changes added to the mysql-simple patch. In particular, it's only used if server's certificate is ephemeral and no CA is provided for connection - those were the latest additions.

I probably should have waited till you adopt this change in the async. Feel free to decline it :) I hope it still can be a good start.

"Zero Config SSL" allows easy secure encrypted connection configuration with MariaDB server versions 11.4.1+. The only thing the application need for that is request encrypted connection and require certificate validation. The server can generate ephemeral certificate if needed. In case normal certificate validation failed the client still have chance to ensure that the certificate is valid and connection is secure. For this purpose the server send additional information - SHA256(password_hash || scramble || certificate fingerprint)). The client knows all three parts required to calculate this signature. If calculated and received hash match - the certificate is considered validated and the connection - secure.
This won't work with empty user passwords and insecure authentication plugins. i.e. it only work with native password, ed25519 and parsec plugins. In such case the error returned that the certificate could not be validated.

The feature is only supported with rustls backend only.

It's based on auth plugins design cnahge in mysql_common 0.38.0 -
considers all changes added to the mysql-simple patch.

"Zero Config SSL" allows easy secure encrypted connection configuration
with MariaDB server versions 11.4.1+. The only thing the application need for
that is request encrypted connection and require certificate
validation. The server can generate ephemeral certificate if needed. In
case normal certificate validation failed the client still have chance
to ensure that the certificate is valid and connection is secure. For
this purpose the server send additional information -
SHA256(password_hash || scramble || certificate fingerprint)). The
client knows all three parts required to calculate this signature. If
calculated and received hash match - the certificate is considered
validated and the connection - secure.
This won't work with empty user passwords and insecure authentication
plugins. i.e. it only work with native password, ed25519 and parsec
plugins. In such case the error returned that the certificate could not
be validated.

Also it's only used if server's certificate is ephemeral and no CA is
provided for connection - those were the latest additions.

The feature is only supported with rustls backend only.
@lawrinn

lawrinn commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@lawrinn

lawrinn commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

I will look into test failure - did not have it locally(on Windows)

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

Successfully merging this pull request may close these issues.

1 participant