mirror of https://github.com/rapiz1/rathole.git
feat: Allow use of system default TLS trusted root by omitting the trusted_root client config parameter. (#192)
This commit is contained in:
parent
064bdcab8e
commit
187f4f0335
|
@ -296,11 +296,6 @@ impl Config {
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and(tls_config.pkcs12_password.as_ref())
|
.and(tls_config.pkcs12_password.as_ref())
|
||||||
.ok_or_else(|| anyhow!("Missing `pkcs12` or `pkcs12_password`"))?;
|
.ok_or_else(|| anyhow!("Missing `pkcs12` or `pkcs12_password`"))?;
|
||||||
} else {
|
|
||||||
tls_config
|
|
||||||
.trusted_root
|
|
||||||
.as_ref()
|
|
||||||
.ok_or_else(|| anyhow!("Missing `trusted_root`"))?;
|
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,11 @@ impl Transport for TlsTransport {
|
||||||
.build()?;
|
.build()?;
|
||||||
Some(TlsConnector::from(connector))
|
Some(TlsConnector::from(connector))
|
||||||
}
|
}
|
||||||
None => None,
|
None => {
|
||||||
|
// if no trusted_root is specified, allow TlsConnector to use system default
|
||||||
|
let connector = native_tls::TlsConnector::builder().build()?;
|
||||||
|
Some(TlsConnector::from(connector))
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let tls_acceptor = match config.pkcs12.as_ref() {
|
let tls_acceptor = match config.pkcs12.as_ref() {
|
||||||
|
|
Loading…
Reference in New Issue