mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 01:55:20 +00:00
http_client: Always close socket on exception (#4399)
This commit is contained in:
parent
b49feec0d3
commit
b4c7abb2b8
@ -60,9 +60,6 @@ void Client::closeSocket() {
|
||||
if (sock_.is_open()) {
|
||||
boost_system::error_code rc;
|
||||
sock_.shutdown(boost_asio::ip::tcp::socket::shutdown_both, rc);
|
||||
if (rc) {
|
||||
return;
|
||||
}
|
||||
sock_.close(rc);
|
||||
}
|
||||
}
|
||||
|
@ -102,13 +102,6 @@ http::Client::Options TLSTransport::getOptions() {
|
||||
options.proxy_hostname(FLAGS_proxy_hostname);
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
// Configuration may allow unsafe TLS testing if compiled as a debug target.
|
||||
if (FLAGS_tls_allow_unsafe) {
|
||||
options.always_verify_peer(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
options.openssl_ciphers(kTLSCiphers);
|
||||
options.openssl_options(SSL_OP_NO_SSLv3 | SSL_OP_NO_SSLv2 | SSL_OP_ALL);
|
||||
|
||||
@ -154,6 +147,13 @@ http::Client::Options TLSTransport::getOptions() {
|
||||
options.openssl_sni_hostname(it->value.GetString());
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
// Configuration may allow unsafe TLS testing if compiled as a debug target.
|
||||
if (FLAGS_tls_allow_unsafe) {
|
||||
options.always_verify_peer(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user