Rewrite all Errors into tls_errors if they happen as part of initializing TLS.
This commit is contained in:
parent
ac52b6b474
commit
9b760fae2d
|
@ -1001,10 +1001,15 @@ void Net2::initTLS() {
|
|||
return;
|
||||
}
|
||||
#ifndef TLS_DISABLED
|
||||
try {
|
||||
boost::asio::ssl::context newContext(boost::asio::ssl::context::tls);
|
||||
ConfigureSSLContext( tlsConfig.loadSync(), &newContext );
|
||||
sslContextVar.set(ReferencedObject<boost::asio::ssl::context>::from(std::move(newContext)));
|
||||
backgroundCertRefresh = reloadCertificatesOnChange( tlsConfig, &sslContextVar );
|
||||
} catch (Error& e) {
|
||||
TraceEvent("Net2TLSInitError").error(e);
|
||||
throw tls_error();
|
||||
}
|
||||
#endif
|
||||
tlsInitialized = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue