Skip to content

Implement SSL Mode #88

@caleblloyd

Description

@caleblloyd

From the connection string reference:

SSL Mode, SslMode

None - do not use SSL.
Preferred - use SSL if the server supports it, but allow connection in all cases.
Required - Always use SSL. Deny connection if server does not support SSL.
VerifyCA - Always use SSL. Validate the CA but tolerate name mismatch.
VerifyFull - Always use SSL. Fail if the host name is not correct.

I think this is a needed feature for 1.0 since many companies require SSL/TLS. Also, some cloud MySQL providers such as Google Cloud SQL run over the public network so they pretty much require SSL/TLS.

A solution would most likely use the SslStream library

Certificate validation based off the SSL Mode options would be performed in the RemoteCertificateValidationCallback, checking the SslPolicyErrors

I don't fully understand why someone would want to use the SSL Mode=Preferred option. It seems to me like this would mask a server misconfiguration. This may be an option that was added to support the legacy Encrypt, UseSSL connection string options. I think we should consider not implementing SSL Mode=Preferred.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions