Skip to content

Commit

Permalink
feat(tls): Add method to add multiple ca certificates at once
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Jun 15, 2024
1 parent c3f9ae5 commit 8781f15
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tonic/src/transport/channel/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ impl ClientTlsConfig {
ClientTlsConfig { certs, ..self }
}

/// Sets the multiple CA Certificates against which to verify the server's TLS certificate.
pub fn ca_certificates(self, ca_certificates: Vec<Certificate>) -> Self {
let mut certs = self.certs;
certs.extend(ca_certificates);
ClientTlsConfig { certs, ..self }
}

/// Sets the client identity to present to the server.
pub fn identity(self, identity: Identity) -> Self {
ClientTlsConfig {
Expand Down

0 comments on commit 8781f15

Please sign in to comment.