set_default_paths only resolves OpenSSL's compile-time CA dirs, which exist on Linux but are empty on Windows. The stealth client's cert store ended up empty there and every TLS handshake failed with CERTIFICATE_VERIFY_FAILED inside BoringSSL handshake.cc. CertStore::default() uses wreq's bundled webpki-root-certs (Mozilla's trust list), which behaves the same on every platform and removes the dependency on a system CA store.
This commit is contained in:
1 parent
1da6032639
commit
8a8c767338
1 file changed
+6
-4
@@ -36,10 +36,12 @@ impl StealthHttpClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_proxy(cookie_jar: Arc<CookieJar>, proxy_url: Option<&str>) -> Self {
|
pub fn with_proxy(cookie_jar: Arc<CookieJar>, proxy_url: Option<&str>) -> Self {
|
||||||
let cert_store = wreq::tls::CertStore::builder()
|
// Issue #184: `set_default_paths()` reads OpenSSL's compile-time CA
|
||||||
.set_default_paths()
|
// paths, which only resolve on Linux. On Windows the store ends up
|
||||||
.build()
|
// empty and every TLS handshake fails with CERTIFICATE_VERIFY_FAILED.
|
||||||
.expect("Failed to load system CA certificates");
|
// `CertStore::default()` uses wreq's bundled Mozilla roots
|
||||||
|
// (`webpki-root-certs`), which works the same on every platform.
|
||||||
|
let cert_store = wreq::tls::CertStore::default();
|
||||||
|
|
||||||
let emulation_opts = wreq_util::EmulationOption::builder()
|
let emulation_opts = wreq_util::EmulationOption::builder()
|
||||||
.emulation(wreq_util::Emulation::Chrome145)
|
.emulation(wreq_util::Emulation::Chrome145)
|
||||||
|
|||||||
Reference in new issue
Block a user