Replies: 2 comments
-
The certificate I am using for the Identity consists of 2 certificates of a cert chain. In addition I have add the root_certificate to the client build, but it has not helped. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The code runs smothly on Linux Ubuntu with openssl. It is a macos issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I like to migrate a RestAPI client from Python to rust. The authentication runs via certificates.
Create Identity: Identity::from_pkcs8_pem(&cert, &key) from 2 pem-files. No complaints
Create a client:
let client = Client::builder()
.identity(auth)
.tls_info(true)
.connection_verbose(true)
.build()?; -> No complaints
Create a request:
let request: reqwest::Request = client.get(&url)
.header(header::CONTENT_TYPE, header::HeaderValue::from_str("application/json").unwrap())
.header(header::HeaderName::from_static(CONTAINER_HEADER),
header::HeaderValue::from_str(&container).unwrap())
.query(&query)
.build()?;
Execute request: let response = match client.execute(request).await?;
The header and url looks exactly as it should but I get an unauthorized.
The logging gives no hint, why the authentication fails. Although it might not play any role but I am using macos.
What can I do to test the tls handshake and find the error?
Many thanks
Beta Was this translation helpful? Give feedback.
All reactions