Skip to content

Add support for custom certificate validation to std.crypto.tls.Client #15681

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

Open
Chris3606 opened this issue May 12, 2023 · 1 comment
Open
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@Chris3606
Copy link

Currently, I don't see a way to customize the certificate validation that takes place, or even to toggle it. Although not a particularly good example with respect to security, I'm thinking of a use case like curl, which provides the -k/--insecure flag allowing you to toggle off hostname validation.

Not sure what degree of versatility/"footgun" type of options are desirable for the standard library, particularly in an area as important to security as certificate validation; however given a custom TLS implementation is difficult to write correctly, it seems like value could be added. Other common TLS implementations like mbedtls do provide ways to customize elements of cert validation (for example, via mbedtls_ssl_conf_verify(), and it may have implications for programs designed to run in environments with custom or self-signed CAs.

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. labels Jul 23, 2023
@andrewrk andrewrk added this to the 0.12.0 milestone Jul 23, 2023
@clickingbuttons
Copy link
Contributor

Would an insecure option and a customizable ca_bundle be enough? That'd allow self signed CAs to be skipped or validated (assuming you have access to the self-signed cert public keys).

What else do you need a callback for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

3 participants