File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,30 @@ pub struct HttpsConnector<T> {
22
22
tls_config : Arc < ClientConfig > ,
23
23
}
24
24
25
+ #[ cfg( all(
26
+ any( feature = "rustls-native-certs" , feature = "webpki-roots" ) ,
27
+ feature = "tokio-runtime"
28
+ ) ) ]
29
+ impl HttpsConnector < HttpConnector > {
30
+ /// Construct a new `HttpsConnector` using the OS root store
31
+ #[ cfg( feature = "rustls-native-certs" ) ]
32
+ #[ cfg_attr( docsrs, doc( cfg( feature = "rustls-native-certs" ) ) ) ]
33
+ pub fn with_native_roots ( ) -> Self {
34
+ HttpsConnectorBuilder :: with_native_roots ( )
35
+ . enable_cert_transparency ( )
36
+ . build ( )
37
+ }
38
+
39
+ /// Construct a new `HttpsConnector` using the `webpki_roots`
40
+ #[ cfg( feature = "webpki-roots" ) ]
41
+ #[ cfg_attr( docsrs, doc( cfg( feature = "webpki-roots" ) ) ) ]
42
+ pub fn with_webpki_roots ( ) -> Self {
43
+ HttpsConnectorBuilder :: with_webpki_roots ( )
44
+ . enable_cert_transparency ( )
45
+ . build ( )
46
+ }
47
+ }
48
+
25
49
/// A builder that will configure an `HttpsConnector`
26
50
///
27
51
/// This builder ensures configuration is consistent.
You can’t perform that action at this time.
0 commit comments