upgrade to native-tls 0.2 + invalid certs (#325)

- Bumps `native-tls` dependency to 0.2 and adapt code accordingly
- Import code used from `tokio-tls` into `connect_async` and adapt dependencies accordinlgy
- Add an option for using `danger_accept_invalid_certs` inside the `Config` struct
This commit is contained in:
Yannick Heinrich
2018-08-08 22:14:36 +02:00
committed by Sean McArthur
parent a25f62f4cb
commit 11f8588989
7 changed files with 212 additions and 47 deletions

View File

@@ -167,6 +167,29 @@ impl ClientBuilder {
self
}
/// Disable certs verification.
///
/// # Warning
///
/// You should think very carefully before you use this method. If
/// hostname verification is not used, any valid certificate for any
/// site will be trusted for use from any other. This introduces a
/// significant vulnerability to man-in-the-middle attacks.
#[inline]
pub fn danger_disable_certs_verification(&mut self) -> &mut ClientBuilder {
self.inner.danger_disable_certs_verification();
self
}
/// Enable certs verification.
///
/// Default is enabled.
#[inline]
pub fn enable_certs_verification(&mut self) -> &mut ClientBuilder {
self.inner.enable_certs_verification();
self
}
/// Sets the default headers for every request.
///
/// # Example