mirror of https://github.com/rapiz1/rathole.git
fix: add error context
This commit is contained in:
parent
b8e824849a
commit
1d5ad9c185
|
@ -32,8 +32,11 @@ impl Transport for TlsTransport {
|
||||||
|
|
||||||
let connector = match config.trusted_root.as_ref() {
|
let connector = match config.trusted_root.as_ref() {
|
||||||
Some(path) => {
|
Some(path) => {
|
||||||
let s = fs::read_to_string(path).await?;
|
let s = fs::read_to_string(path)
|
||||||
let cert = Certificate::from_pem(s.as_bytes())?;
|
.await
|
||||||
|
.with_context(|| "Failed to read the `tls.trusted_root`")?;
|
||||||
|
let cert = Certificate::from_pem(s.as_bytes())
|
||||||
|
.with_context(|| "Failed to read certificate from `tls.trusted_root`")?;
|
||||||
let connector = native_tls::TlsConnector::builder()
|
let connector = native_tls::TlsConnector::builder()
|
||||||
.add_root_certificate(cert)
|
.add_root_certificate(cert)
|
||||||
.build()?;
|
.build()?;
|
||||||
|
|
Loading…
Reference in New Issue