Skip to content

Commit 6cd6eb3

Browse files
committed
Add From<(H, C, Arc<dyn ResolveServerName + Send + Sync>)> to HttpsConnector
1 parent e6a2371 commit 6cd6eb3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/connector.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ where
126126
}
127127
}
128128

129+
impl<H, C> From<(H, C, Arc<dyn ResolveServerName + Send + Sync>)> for HttpsConnector<H>
130+
where
131+
C: Into<Arc<rustls::ClientConfig>>,
132+
{
133+
fn from(
134+
(http, cfg, server_name_resolver): (H, C, Arc<dyn ResolveServerName + Send + Sync>),
135+
) -> Self {
136+
Self {
137+
force_https: false,
138+
http,
139+
tls_config: cfg.into(),
140+
server_name_resolver,
141+
}
142+
}
143+
}
144+
129145
impl<T> fmt::Debug for HttpsConnector<T> {
130146
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
131147
f.debug_struct("HttpsConnector")

0 commit comments

Comments
 (0)