diff --git a/client/build.sh b/client/build.sh index 91c039e..9efa6f1 100755 --- a/client/build.sh +++ b/client/build.sh @@ -53,7 +53,7 @@ AUTOGENERATED_SNIPPET_PATH=${AUTOGENERATED_SNIPPET_PATH#*$'\''} AUTOGENERATED_SNIPPET_PATH=${AUTOGENERATED_SNIPPET_PATH%%$'\''*} # replace a dot at the start of the var with out -AUTOGENERATED_SNIPPET=$(base64 -w0 ${AUTOGENERATED_SNIPPET_PATH/#./out}) +AUTOGENERATED_SNIPPET=$(base64 -w0 "${AUTOGENERATED_SNIPPET_PATH/#./out}") AUTOGENERATED_SOURCE=${AUTOGENERATED_SOURCE//${AUTOGENERATED_SNIPPET_PATH}/data:application/javascript$';'base64,${AUTOGENERATED_SNIPPET}} @@ -77,7 +77,7 @@ echo "$AUTOGENERATED_SOURCE" > pkg/epoxy.js echo "$AUTOGENERATED_INFO_FUNC" >> pkg/epoxy.js WASM_BASE64=$(base64 -w0 out/epoxy_client_bg.wasm) -AUTOGENERATED_SOURCE=${AUTOGENERATED_SOURCE//__wbg_init(module_or_path, memory) \{/__wbg_init(module_or_path, memory) \{$'\n\t'module_or_path ||= $'{};\n\t'module_or_path.module_or_path=\'data:application/wasm;base64,$WASM_BASE64\'} +AUTOGENERATED_SOURCE=${AUTOGENERATED_SOURCE//__wbg_init(module_or_path, memory) \{/__wbg_init(module_or_path, memory) \{$'\n\t'module_or_path ||= $'{};\n\t'module_or_path.module_or_path=new URL(\'data:application/wasm;base64,$WASM_BASE64\')} echo "$AUTOGENERATED_SOURCE" > pkg/epoxy-bundled.js echo "$AUTOGENERATED_INFO_FUNC" >> pkg/epoxy-bundled.js diff --git a/client/src/lib.rs b/client/src/lib.rs index 83dce6b..01cdfbc 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -348,7 +348,10 @@ impl EpoxyClient { client, redirect_limit: options.redirect_limit, user_agent: options.user_agent, + #[cfg(feature = "full")] certs_tampered: !options.pem_files.is_empty(), + #[cfg(not(feature = "full"))] + certs_tampered: false, }) } diff --git a/client/src/stream_provider.rs b/client/src/stream_provider.rs index de0886d..e33e900 100644 --- a/client/src/stream_provider.rs +++ b/client/src/stream_provider.rs @@ -1,5 +1,5 @@ use std::{ - io::{BufReader, ErrorKind}, + io::{ErrorKind}, pin::Pin, sync::Arc, task::Poll, @@ -7,7 +7,7 @@ use std::{ use cfg_if::cfg_if; use futures_rustls::{ - rustls::{crypto::ring::default_provider, ClientConfig, RootCertStore}, + rustls::{ClientConfig, RootCertStore}, TlsConnector, }; use futures_util::{ @@ -25,11 +25,7 @@ use wisp_mux::{ ClientMux, MuxStreamAsyncRW, MuxStreamIo, StreamType, }; -use crate::{ - console_log, - utils::{IgnoreCloseNotify, NoCertificateVerification}, - EpoxyClientOptions, EpoxyError, -}; +use crate::{console_log, utils::IgnoreCloseNotify, EpoxyClientOptions, EpoxyError}; pub type ProviderUnencryptedStream = MuxStreamIo; pub type ProviderUnencryptedAsyncRW = MuxStreamAsyncRW; @@ -75,7 +71,7 @@ impl StreamProvider { .pem_files .iter() .flat_map(|x| { - rustls_pemfile::certs(&mut BufReader::new(x.as_bytes())) + rustls_pemfile::certs(&mut std::io::BufReader::new(x.as_bytes())) .map(|x| x.map(|x| webpki::anchor_from_trusted_cert(&x).map(|x| x.to_owned()))) .collect::>() })