@@ -7,13 +7,28 @@ use tracing::warn;
77use crate :: environment;
88use crate :: modules:: https:: { set_http_version, set_pool_idle_timeout_seconds, HttpVersion } ;
99
10- #[ cfg( any( feature = "tls-ring" , feature = "tls-aws-lc" , feature = "tls-graviola" ) ) ]
10+ #[ cfg( any(
11+ feature = "tls-rust" ,
12+ feature = "tls-ring" ,
13+ feature = "tls-aws-lc" ,
14+ feature = "tls-graviola"
15+ ) ) ]
1116use std:: { fs:: File , io} ;
1217
13- #[ cfg( any( feature = "tls-ring" , feature = "tls-aws-lc" , feature = "tls-graviola" ) ) ]
18+ #[ cfg( any(
19+ feature = "tls-rust" ,
20+ feature = "tls-ring" ,
21+ feature = "tls-aws-lc" ,
22+ feature = "tls-graviola"
23+ ) ) ]
1424use rustls:: { pki_types:: CertificateDer , version, SupportedProtocolVersion } ;
1525
16- #[ cfg( any( feature = "tls-ring" , feature = "tls-aws-lc" , feature = "tls-graviola" ) ) ]
26+ #[ cfg( any(
27+ feature = "tls-rust" ,
28+ feature = "tls-ring" ,
29+ feature = "tls-aws-lc" ,
30+ feature = "tls-graviola"
31+ ) ) ]
1732use crate :: modules:: tls:: { set_extra_ca_certs, set_tls_versions} ;
1833
1934#[ cfg( feature = "tls-openssl" ) ]
@@ -24,7 +39,12 @@ pub fn init() -> StdResult<(), Box<dyn std::error::Error + Send + Sync>> {
2439 set_pool_idle_timeout_seconds ( pool_idle_timeout) ;
2540 }
2641
27- #[ cfg( any( feature = "tls-ring" , feature = "tls-aws-lc" , feature = "tls-graviola" ) ) ]
42+ #[ cfg( any(
43+ feature = "tls-rust" ,
44+ feature = "tls-ring" ,
45+ feature = "tls-aws-lc" ,
46+ feature = "tls-graviola"
47+ ) ) ]
2848 {
2949 if let Some ( extra_ca_certs) = build_extra_ca_certs ( ) ? {
3050 set_extra_ca_certs ( extra_ca_certs) ;
@@ -59,7 +79,12 @@ fn build_pool_idle_timeout() -> Option<u64> {
5979 Some ( pool_idle_timeout)
6080}
6181
62- #[ cfg( any( feature = "tls-ring" , feature = "tls-aws-lc" , feature = "tls-graviola" ) ) ]
82+ #[ cfg( any(
83+ feature = "tls-rust" ,
84+ feature = "tls-ring" ,
85+ feature = "tls-aws-lc" ,
86+ feature = "tls-graviola"
87+ ) ) ]
6388fn build_extra_ca_certs ( ) -> StdResult < Option < Vec < CertificateDer < ' static > > > , io:: Error > {
6489 if let Ok ( extra_ca_certs) = env:: var ( environment:: ENV_LLRT_EXTRA_CA_CERTS ) {
6590 if !extra_ca_certs. is_empty ( ) {
@@ -76,7 +101,12 @@ fn build_extra_ca_certs() -> StdResult<Option<Vec<CertificateDer<'static>>>, io:
76101 Ok ( None )
77102}
78103
79- #[ cfg( any( feature = "tls-ring" , feature = "tls-aws-lc" , feature = "tls-graviola" ) ) ]
104+ #[ cfg( any(
105+ feature = "tls-rust" ,
106+ feature = "tls-ring" ,
107+ feature = "tls-aws-lc" ,
108+ feature = "tls-graviola"
109+ ) ) ]
80110fn build_tls_versions ( ) -> Vec < & ' static SupportedProtocolVersion > {
81111 match env:: var ( environment:: ENV_LLRT_TLS_VERSION ) . as_deref ( ) {
82112 Ok ( "1.3" ) => vec ! [ & version:: TLS13 , & version:: TLS12 ] ,
0 commit comments