Skip to content

Commit fc93c58

Browse files
committed
Added HttpsConnector::new function
1 parent aff7441 commit fc93c58

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/connector.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ impl<T> HttpsConnector<T> {
3535
builder::ConnectorBuilder::new()
3636
}
3737

38+
/// Creates a new `HttpsConnector`.
39+
///
40+
/// The recommended way to create a `HttpsConnector` is to use a [`crate::HttpsConnectorBuilder`]. See [`HttpsConnector::builder()`].
41+
pub fn new(
42+
http: T,
43+
tls_config: impl Into<Arc<rustls::ClientConfig>>,
44+
force_https: bool,
45+
server_name_resolver: Arc<dyn ResolveServerName + Send + Sync>,
46+
) -> Self {
47+
Self {
48+
http,
49+
tls_config: tls_config.into(),
50+
force_https,
51+
server_name_resolver,
52+
}
53+
}
54+
3855
/// Force the use of HTTPS when connecting.
3956
///
4057
/// If a URL is not `https` when connecting, an error is returned.

0 commit comments

Comments
 (0)