File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ yaml = ["yaml_config"]
3838proxy = [" tokio-socks" ]
3939
4040tls-native = [" native-tls" , " tokio-native-tls" ]
41- tls-rust = [" tokio- rustls" , " webpki-roots " , " rustls-pemfile " ]
41+ tls-rust = [" rustls-native-certs " , " rustls-pemfile " , " tokio- rustls" , " webpki-roots " ]
4242encoding = [" dep:encoding" , " irc-proto/encoding" ]
4343
4444[dependencies ]
@@ -65,9 +65,10 @@ tokio-socks = { version = "0.5.1", optional = true }
6565
6666# Feature - TLS
6767native-tls = { version = " 0.2.11" , optional = true }
68- tokio-rustls = { version = " 0.26.0" , optional = true }
69- rustls-pemfile = { version = " 2" , optional = true }
7068tokio-native-tls = { version = " 0.3.1" , optional = true }
69+ rustls-native-certs = { version = " 0.8" , optional = true }
70+ rustls-pemfile = { version = " 2" , optional = true }
71+ tokio-rustls = { version = " 0.26.0" , optional = true }
7172webpki-roots = { version = " 0.26.0" , optional = true }
7273
7374
Original file line number Diff line number Diff line change @@ -341,10 +341,15 @@ impl Connection {
341341 . with_custom_certificate_verifier ( Arc :: new ( DangerousAcceptAllVerifier :: new ( ) ) ) ;
342342 make_client_auth ! ( builder)
343343 } else {
344- let mut root_store = webpki_roots:: TLS_SERVER_ROOTS
345- . iter ( )
346- . cloned ( )
347- . collect :: < RootCertStore > ( ) ;
344+ let mut root_store = RootCertStore :: empty ( ) ;
345+
346+ #[ cfg( feature = "webpki-roots" ) ]
347+ root_store. extend ( webpki_roots:: TLS_SERVER_ROOTS . iter ( ) . cloned ( ) ) ;
348+
349+ let native_certs = rustls_native_certs:: load_native_certs ( ) ;
350+ for cert in native_certs. certs {
351+ root_store. add ( cert. into ( ) ) ?;
352+ }
348353
349354 if let Some ( cert_path) = config. cert_path ( ) {
350355 if let Ok ( file) = File :: open ( cert_path) {
You can’t perform that action at this time.
0 commit comments