Report errors on TLS misconfigurations ... or at least try to.
This commit is contained in:
parent
f7a37077cc
commit
927cff3317
|
@ -108,7 +108,12 @@ fdb_error_t fdb_network_set_option( FDBNetworkOption option,
|
|||
}
|
||||
|
||||
fdb_error_t fdb_setup_network_impl() {
|
||||
CATCH_AND_RETURN( API->setupNetwork(); );
|
||||
CATCH_AND_RETURN(
|
||||
try {
|
||||
API->setupNetwork();
|
||||
} catch (boost::system::system_error& e) {
|
||||
return error_code_tls_error;
|
||||
} );
|
||||
}
|
||||
|
||||
fdb_error_t fdb_setup_network_v13( const char* localAddress ) {
|
||||
|
|
|
@ -3657,6 +3657,13 @@ int main(int argc, char* argv[]) {
|
|||
} catch (Error& e) {
|
||||
TraceEvent(SevError, "MainError").error(e);
|
||||
status = FDB_EXIT_MAIN_ERROR;
|
||||
} catch (boost::system::system_error& e) {
|
||||
if (g_network) {
|
||||
TraceEvent(SevError, "MainError").error(unknown_error()).detail("RootException", e.what());
|
||||
} else {
|
||||
fprintf(stderr, "ERROR: %s (%d)\n", e.what(), e.code().value());
|
||||
}
|
||||
status = FDB_EXIT_MAIN_EXCEPTION;
|
||||
} catch (std::exception& e) {
|
||||
TraceEvent(SevError, "MainError").error(unknown_error()).detail("RootException", e.what());
|
||||
status = FDB_EXIT_MAIN_EXCEPTION;
|
||||
|
|
|
@ -3753,5 +3753,8 @@ int main(int argc, char **argv) {
|
|||
} catch (Error& e) {
|
||||
printf("ERROR: %s (%d)\n", e.what(), e.code());
|
||||
return 1;
|
||||
} catch (boost::system::system_error& e) {
|
||||
printf("ERROR: %s (%d)\n", e.what(), e.code().value());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1963,6 +1963,11 @@ int main(int argc, char* argv[]) {
|
|||
TraceEvent(SevError, "MainError").error(e);
|
||||
//printf("\n%d tests passed; %d tests failed\n", passCount, failCount);
|
||||
flushAndExit(FDB_EXIT_MAIN_ERROR);
|
||||
} catch (boost::system::system_error& e) {
|
||||
fprintf(stderr, "boost::system::system_error: %s (%d)", e.what(), e.code().value());
|
||||
TraceEvent(SevError, "MainError").error(unknown_error()).detail("RootException", e.what());
|
||||
//printf("\n%d tests passed; %d tests failed\n", passCount, failCount);
|
||||
flushAndExit(FDB_EXIT_MAIN_EXCEPTION);
|
||||
} catch (std::exception& e) {
|
||||
fprintf(stderr, "std::exception: %s\n", e.what());
|
||||
TraceEvent(SevError, "MainError").error(unknown_error()).detail("RootException", e.what());
|
||||
|
|
|
@ -1456,7 +1456,7 @@ INetwork* newNet2(bool useThreadPool, bool useMetrics, Reference<TLSPolicy> poli
|
|||
}
|
||||
catch(boost::system::system_error e) {
|
||||
TraceEvent("Net2InitError").detail("Message", e.what());
|
||||
throw unknown_error();
|
||||
throw;
|
||||
}
|
||||
catch(std::exception const& e) {
|
||||
TraceEvent("Net2InitError").detail("Message", e.what());
|
||||
|
|
Loading…
Reference in New Issue