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

Add SslCa connection string option #640

Closed
bgrainger opened this issue May 23, 2019 · 2 comments
Closed

Add SslCa connection string option #640

bgrainger opened this issue May 23, 2019 · 2 comments
Assignees
Milestone

Comments

@bgrainger
Copy link
Member

In Connector/NET 8.0, an SslCa connection string option was added. https://dev.mysql.com/doc/connector-net/en/connector-net-8-0-connection-options.html:

SslCa , Ssl-Ca
Default: null

Based on the type of certificates being used, this option either specifies the path to a certificate file in PKCS #12 format (.pfx) or the path to a file in PEM format (.pem) that contains a list of trusted SSL certificate authorities (CA).

We already support loading the server's certificate in PEM format with the CACertificateFile option.

For compatibility, SslCa and Ssl-Ca should be added as synonyms.

@bgrainger
Copy link
Member Author

In Connector/NET, SslCa (server CA key) and CertificateFile (client SSL certificate) are aliases of each other in the connection string.

From https://dev.mysql.com/doc/connector-net/en/connector-net-8-0-connection-options.html:

Based on the type of certificates being used, this option either specifies the path to a certificate file in PKCS #12 format (.pfx) or the path to a file in PEM format (.pem) that contains a list of trusted SSL certificate authorities (CA).

This means that with Connector/NET, you can have a connection string in the format CertificateFile=server-ca.pem;SslKey=client-key.pem;SslCert=client-cert.pem and it will use server-ca.pem to verify the server's certificate.

This is incompatible with MySqlConnector, which always uses CertificateFile for the client certificate and allows it to be used in combination with CACertificateFile (aka SslCa) to specify the server's CA key.

Fortunately, all the Oracle documentation gives the option name as SslCa in their examples, so migration from their recommended syntax will work fine.

@bgrainger
Copy link
Member Author

Filed an Oracle bug stating why I think their implementation is flawed: https://bugs.mysql.com/bug.php?id=95526

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

No branches or pull requests

1 participant