You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During tests, it can be useful to disable certificate verification on the client side.
Use Case
There is a workaround today by configuring an HTTP connector like so:
/* In Cargo.toml, have these dependencies somewhere rustls = { version = "0.21.8", features = ["dangerous_configuration"] } hyper-rustls = "0.24"*/structNoCertificateVerification{}impl rustls::client::ServerCertVerifierforNoCertificateVerification{fnverify_server_cert(&self,_end_entity:&rustls::Certificate,_intermediates:&[rustls::Certificate],_server_name:&rustls::ServerName,_scts:&mutdynIterator<Item = &[u8]>,_ocsp:&[u8],_now: std::time::SystemTime,) -> Result<rustls::client::ServerCertVerified, rustls::Error>{Ok(rustls::client::ServerCertVerified::assertion())}}fnget_rustls_config_dangerous() -> ClientConfig{letmut store = rustls::RootCertStore::empty();letmut config = ClientConfig::builder().with_safe_defaults().with_root_certificates(store).with_no_client_auth();// this disables cert-verificationletmut dangerous_config = ClientConfig::dangerous(&mut config);
dangerous_config.set_certificate_verifier(Arc::new(NoCertificateVerification{}));
config
}#[tokio::main]asyncfnfoo(){let conn = hyper_rustls::HttpsConnectorBuilder::new().with_tls_config(get_rustls_config_dangerous()).https_only().enable_http1().build();let http_client = HyperClientBuilder::new().build(conn);let shared_config = aws_config::from_env().region(/* service region */).endpoint_url(/* service endpoint */).http_client(http_client).load().await;// construct a service client e.g.// let client = aws_sdk_s3::Client::new(&shared_config);//// and call some operation on `client`// ...}
But having a method that works out of the box would be more ergonomic.
Proposed Solution
This will be an opt-in feature and the method can be called as follows (using the above snippet)
// No boilerplate like above#[tokio::main]asyncfnfoo(){let shared_config = aws_config::from_env().region(/* service region */).endpoint_url(/* service endpoint */).no_certificate_validation(..).load().await;// ...}
Other Information
No response
Acknowledgements
I may be able to implement this feature request
This feature might incur a breaking change
A note for the community
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue, please leave a comment
The text was updated successfully, but these errors were encountered:
Velfi
changed the title
Support for disabling client side verification in aws-config
Support for disabling client-side certificate verification in aws-configJul 30, 2024
Describe the feature
During tests, it can be useful to disable certificate verification on the client side.
Use Case
There is a workaround today by configuring an HTTP connector like so:
But having a method that works out of the box would be more ergonomic.
Proposed Solution
This will be an opt-in feature and the method can be called as follows (using the above snippet)
Other Information
No response
Acknowledgements
A note for the community
Community Note
The text was updated successfully, but these errors were encountered: