Skip to content

The rustls-platform-verifier cannot be initialised when web request in termux #41

Description

@AdairLi2504

I built from source and installed it in termux. When I tested kraken ticker BTCUSD, it showed an error that


thread 'main' (17113) panicked at /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-platform-verifier-0.7.0/src/android.rs:90:10:
Expect rustls-platform-verifier to be initialized
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The detailed log under RUST_BACKTRACE=full is


thread 'main' (17129) panicked at /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-platform-verifier-0.7.0/src/android.rs:90:10:
Expect rustls-platform-verifier to be initialized
stack backtrace:
   0:     0x5555562106b5 - <<std[30a1abfda9a2f578]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[64ed50c6d97ba653]::fmt::Display>::fmt
   1:     0x55555624c68a - core[64ed50c6d97ba653]::fmt::write
   2:     0x555556226366 - std[30a1abfda9a2f578]::io::default_write_fmt::<std[30a1abfda9a2f578]::sys::stdio::unix::Stderr>
   3:     0x555556208966 - std[30a1abfda9a2f578]::panicking::default_hook::{closure#0}
   4:     0x55555620d033 - std[30a1abfda9a2f578]::panicking::default_hook
   5:     0x55555620d322 - std[30a1abfda9a2f578]::panicking::panic_with_hook
   6:     0x555556208a18 - std[30a1abfda9a2f578]::panicking::panic_handler::{closure#0}
   7:     0x555556208029 - std[30a1abfda9a2f578]::sys::backtrace::__rust_end_short_backtrace::<std[30a1abfda9a2f578]::panicking::panic_handler::{closure#0}, !>
   8:     0x5555562096ad - __rustc[d8ff9d08a1174409]::rust_begin_unwind
   9:     0x55555624ce6c - core[64ed50c6d97ba653]::panicking::panic_fmt
  10:     0x555556253544 - core[64ed50c6d97ba653]::option::expect_failed
  11:     0x555555e37593 - rustls_platform_verifier::verification::android::Verifier::verify_certificate::ha7db65b63c31dc71
  12:     0x555555e36838 - <rustls_platform_verifier::verification::android::Verifier as rustls::verify::ServerCertVerifier>::verify_server_cert::hd012c17f9ad0b703
  13:     0x555555ea5296 - <rustls::client::tls13::ExpectCertificateVerify as rustls::common_state::State<rustls::client::client_conn::ClientConnectionData>>::handle::h4a4f3bfa7b5e09f1
  14:     0x555555e26b41 - rustls::common_state::CommonState::process_main_protocol::h8aa5d4b355beed39
  15:     0x555555df2cee - rustls::conn::ConnectionCore<Data>::process_new_packets::h25307151b474863f
  16:     0x555555deca46 - tokio_rustls::common::Stream<IO,C>::read_io::he1e15be12c784310
  17:     0x555555decf6d - tokio_rustls::common::Stream<IO,C>::handshake::h7aaa99d1a9999a18
  18:     0x555555e1fd5d - <tokio_rustls::common::handshake::MidHandshake<IS> as core::future::future::Future>::poll::h36ed204c94544312
  19:     0x555555dd3166 - <hyper_rustls::connector::HttpsConnector<T> as tower_service::Service<http::uri::Uri>>::call::{{closure}}::h4b912f626f8ec7bf
  20:     0x555555de9f6b - reqwest::connect::ConnectorService::connect_with_maybe_proxy::{{closure}}::h6a03436cb9c8d82d
  21:     0x555555de81c2 - reqwest::connect::with_timeout::{{closure}}::hf2ad30ee171deadd
  22:     0x555555dfe1ec - <hyper_util::service::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll::h679b30946de0b434
  23:     0x555555ddbd24 - <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll::h7769ae3e7115c74b
  24:     0x555555ddb742 - <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll::h34992aba5602de78
  25:     0x555555e10ef1 - <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll::h6048955fa6d7aba6
  26:     0x555555e0976c - <hyper_util::common::lazy::Lazy<F,R> as core::future::future::Future>::poll::h6392ffb23fe8537f
  27:     0x555555e35f87 - <futures_util::future::select::Select<A,B> as core::future::future::Future>::poll::h103bdc477bdfd923
  28:     0x555555dff573 - hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}::h811ed493a8c38acd
  29:     0x555556129951 - <hyper_util::client::legacy::client::ResponseFuture as core::future::future::Future>::poll::h62e995fe6b226ae5
  30:     0x555555dae95c - <reqwest::async_impl::client::HyperService as tower_service::Service<http::request::Request<reqwest::async_impl::body::Body>>>::call::{{closure}}::hc406cd6d66d652de
  31:     0x555555dfe409 - <tower::retry::future::ResponseFuture<P,S,Request> as core::future::future::Future>::poll::hac0a27f7ba105d80
  32:     0x555555e02eaa - <tower_http::follow_redirect::ResponseFuture<S,ReqBody,P> as core::future::future::Future>::poll::hdcc0a7d11927ac0e
  33:     0x555555dba4e8 - <reqwest::async_impl::client::PendingRequest as core::future::future::Future>::poll::he7c1a9502ae5bcd4
  34:     0x555555dba394 - <reqwest::async_impl::client::Pending as core::future::future::Future>::poll::h91f81d8e2a8fc7c2
  35:     0x5555559366da - kraken_cli::client::SpotClient::public_get::{{closure}}::hd1e0964721b47f9f
  36:     0x555555963099 - kraken_cli::commands::market::execute::{{closure}}::h96905ded57344c7d
  37:     0x555555925df2 - kraken_cli::execute_command::{{closure}}::h408a38577eafe7bf
  38:     0x55555598c7ef - kraken_cli::dispatch::{{closure}}::h4f2f28e1ac9824c4
  39:     0x5555559b03a9 - kraken::main::{{closure}}::he4d6e5f7e6758965
  40:     0x555555924c07 - tokio::runtime::park::CachedParkThread::block_on::h9897c2139488db05
  41:     0x555555ac9125 - tokio::runtime::context::runtime::enter_runtime::hec5be097a161c32f
  42:     0x555555b35a53 - tokio::runtime::runtime::Runtime::block_on::h05c75f82a49f40ca
  43:     0x555555b0178f - kraken::main::hd0ea951574840731
  44:     0x555555b1d113 - std::sys::backtrace::__rust_begin_short_backtrace::h92e851b4cc0fcd21
  45:     0x555555b1d109 - std::rt::lang_start::{{closure}}::hb30d0d0dac55dfea
  46:     0x55555620cb54 - std[30a1abfda9a2f578]::rt::lang_start_internal
  47:     0x555555b03075 - main
  48:     0xffff8410277d - __libc_init

This bug can be reproduced when I try other command including web requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions