Support `ClientCertificate` keyword in Connection String
- Dominant language
- C#
- Stars
- 989
- Forks
- 340
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 72
Description
### Is your feature request related to a problem? Please describe.
SqlClient does not currently support the `ClientCertificate` keyword in a connection string. This prevents applications from specifying a client certificate directly in the connection configuration for scenarios that require certificate-based authentication or mutual TLS.
Because this setting cannot be expressed in a standard connection string, developers are forced to use custom configuration workarounds outside the SqlClient connection model, which is less portable, less discoverable, and harder to maintain.
### Describe the solution you'd like
Add support for the `ClientCertificate` keyword in the SqlClient connection string so that a client certificate can be configured directly as part of the connection string.
The expected behavior should include:
- accepting `ClientCertificate` in the connection string
- validating and parsing the value consistently with other SqlClient connection-string keywords
- passing the configured certificate through the connection flow to the underlying authentication logic
- documenting the option in the SqlClient connection-string reference and examples
This would make certificate-based authentication easier to configure and align SqlClient with standard connection-string-based configuration patterns.
### Describe alternatives you've considered
- Relying on `System.Data.Odbc` instead of `SqlClient`.
### Additional context
Support for `ClientCertificate` would be valuable in secure deployment scenarios that rely on certificate-based authentication, mutual TLS, or centralized certificate management. Enabling this option in the connection string would improve usability, consistency, and portability for developers using SqlClient in real-world secure environments.
Contributor guide
Research direction
Start by locating SqlClient's connection-string keyword handling, validation and parsing, then trace the connection flow into the underlying authentication logic. Confirm the ClientCertificate value reaches authentication consistently, and update the connection-string reference and examples so the option and its expected format are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- authentication, database, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100