@@ -5,7 +5,7 @@ use std::io::{self, IsTerminal, stderr, stdin};
55use std:: path:: { Path , PathBuf } ;
66
77use std:: process:: { Command , exit} ;
8- use std:: sync:: { Arc , LazyLock , OnceLock } ;
8+ use std:: sync:: { LazyLock , OnceLock } ;
99use std:: thread;
1010use std:: time:: { Duration , SystemTime , UNIX_EPOCH } ;
1111
@@ -37,8 +37,6 @@ use oma_utils::dbus::{create_dbus_connection, get_another_oma_status};
3737use oma_utils:: { OsRelease , is_termux} ;
3838use reqwest:: Client ;
3939use rustix:: stdio:: stdout;
40- use rustls:: ClientConfig ;
41- use rustls_platform_verifier:: BuilderVerifierExt ;
4240use subcommand:: utils:: { LockError , is_terminal} ;
4341use tokio:: runtime:: Runtime ;
4442use tracing:: { debug, error, info, warn} ;
@@ -71,9 +69,10 @@ static RT: LazyLock<Runtime> = LazyLock::new(|| {
7169} ) ;
7270
7371static HTTP_CLIENT : LazyLock < Client > = LazyLock :: new ( || {
72+ init_tls_config ( ) ;
73+
7474 Client :: builder ( )
7575 . user_agent ( APP_USER_AGENT )
76- . tls_backend_preconfigured ( tls_config ( ) )
7776 . build ( )
7877 . unwrap ( )
7978} ) ;
@@ -480,15 +479,12 @@ fn try_main(
480479 code
481480}
482481
483- fn tls_config ( ) -> ClientConfig {
484- let arc_crypto_provider = Arc :: new ( rustls:: crypto:: ring:: default_provider ( ) ) ;
485-
486- ClientConfig :: builder_with_provider ( arc_crypto_provider)
487- . with_safe_default_protocol_versions ( )
488- . unwrap ( )
489- . with_platform_verifier ( )
490- . unwrap ( )
491- . with_no_client_auth ( )
482+ /// Initialize ring TLS config for HTTP client
483+ #[ inline]
484+ fn init_tls_config ( ) {
485+ rustls:: crypto:: ring:: default_provider ( )
486+ . install_default ( )
487+ . expect ( "Failed to install rustls crypto provider" ) ;
492488}
493489
494490fn init_color_formatter ( oma : & OhManagerAilurus , config : & Config ) {
0 commit comments