Skip to content

client certificate verification: builder style API #1360

@jsha

Description

@jsha

Over in rustls/rustls-ffi#324 (review) we talked a bit about the current API for the built-in implementations of ClientCertVerifier:

AllowAnyAnonymousOrAuthenticatedClient

AllowAnyAuthenticatedClient

NoClientAuth

The naming of these is a little verbose and confusing, and now that they take a CRLs argument, they are a bit redundant. Instead, we could adopt a builder-style API that could construct these, like ServerConfig. E.g.:

ClientVerifier::builder()
  .with_roots(root_store)
  .with_crls(crls)
  .allow_unauthenticated()
  .build()

ClientVerifier::builder()
  .with_roots(root_store)
  .without_crls()
  .build()

// equivalent to NoClientAuth; or we could keep NoClientAuth as a shortcut for this
ClientVerifier::builder()
  .allow_unauthenticated()
  .build()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions