Skip to content

feat(tls): Add ability to add multiple ca certificates - #1724

Merged
djc merged 2 commits into
grpc:masterfrom
tottoto:multiple-ca-certificates
Jun 15, 2024
Merged

djc merged 2 commits into
grpc:masterfrom
tottoto:multiple-ca-certificates

Conversation

@tottoto

@tottoto tottoto commented Jun 12, 2024

Copy link
Copy Markdown
Contributor

Resolves #1629.

@tottoto
tottoto force-pushed the multiple-ca-certificates branch 4 times, most recently from bd66035 to c3f9ae5 Compare June 13, 2024 10:03

@djc djc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the next step here to get rid of the Certificate abstraction around CertificateDer<'_>? Would be nice!

@tottoto

tottoto commented Jun 14, 2024

Copy link
Copy Markdown
Contributor Author

I would think that Certificate interface cannot be removed to support PEM encoded certificate file.

@djc

djc commented Jun 14, 2024

Copy link
Copy Markdown
Contributor

Well, the caller would rely on rustls-pemfile so it's one less mandatory dependency to carry within tonic.

@tottoto

tottoto commented Jun 14, 2024

Copy link
Copy Markdown
Contributor Author

Considering rustls-pemfile has major version release, I would think it would be acceptable to depend on the crate for the purpose of easiness to use.

@tottoto

tottoto commented Jun 15, 2024

Copy link
Copy Markdown
Contributor Author

Added a method to add multiple ca certificates at once, which is useful when having some sets of certificates.

@tottoto
tottoto force-pushed the multiple-ca-certificates branch from 8781f15 to 9e76a66 Compare June 15, 2024 09:27
@tottoto
tottoto force-pushed the multiple-ca-certificates branch from 9e76a66 to 0837c0b Compare June 15, 2024 10:27
Comment thread tonic/src/transport/channel/tls.rs Outdated
}

/// Sets the multiple CA Certificates against which to verify the server's TLS certificate.
pub fn ca_certificates(self, ca_certificates: Vec<Certificate>) -> Self {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's take an impl IntoIterator<Item = Certificate> here, instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Updated to use it.

@tottoto
tottoto force-pushed the multiple-ca-certificates branch from 0837c0b to 2c3ebee Compare June 15, 2024 12:09
@djc
djc added this pull request to the merge queue Jun 15, 2024
Merged via the queue into grpc:master with commit 3457f92 Jun 15, 2024
@tottoto
tottoto deleted the multiple-ca-certificates branch June 15, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: permit multiple ca_certificates

2 participants