-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
B-upstreamBlocked: upstream. Depends on a dependency to make a change first.Blocked: upstream. Depends on a dependency to make a change first.
Description
I'm trying to POST to an external http server which uses a self signed certificate. I have put this certificate in a PEM file that I read using Certificate::from_pem and pass to Client::builder(). This worked on macOS using native TLS, but after I switched to rustls-tls I need to also call (on both macOS and Linux):
Client::builder()
// ...
.add_root_certificate(config.server_certificate)
.danger_accept_invalid_certs(true) // <- required with rustls-tls
.use_rustls_tls(); // <- required with rustls-tls
Why is this? I don't want to accept invalid certificates, just trust the provided server certificate. (There is no chain of certificates, just one)
The error I get is:
source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidCertificateData("invalid peer certificate: UnknownIssuer") } })
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
B-upstreamBlocked: upstream. Depends on a dependency to make a change first.Blocked: upstream. Depends on a dependency to make a change first.