File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
boost/network/protocol/http/client/connection Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -26,19 +26,17 @@ void boost::network::http::ssl_delegate::connect(
26
26
options_.openssl_certificate_paths ();
27
27
std::list<std::string> const & verifier_paths =
28
28
options_.openssl_verify_paths ();
29
- bool verify_peer = false ;
29
+ bool verify_peer = !certificate_paths.empty () || !verifier_paths.empty ();
30
+ if (verify_peer) context_->set_verify_mode (asio::ssl::context::verify_peer);
31
+ else context_->set_verify_mode (asio::ssl::context::verify_none);
30
32
for (std::list<std::string>::const_iterator it = certificate_paths.begin ();
31
33
it != certificate_paths.end (); ++it) {
32
34
context_->load_verify_file (*it);
33
- verify_peer = true ;
34
35
}
35
36
for (std::list<std::string>::const_iterator it = verifier_paths.begin ();
36
37
it != verifier_paths.begin (); ++it) {
37
38
context_->add_verify_path (*it);
38
- verify_peer = true ;
39
39
}
40
- if (verify_peer) context_->set_verify_mode (asio::ssl::context::verify_peer);
41
- else context_->set_verify_mode (asio::ssl::context::verify_none);
42
40
socket_.reset (new asio::ssl::stream<asio::ip::tcp::socket>(service_, *context_));
43
41
socket_->lowest_layer ().async_connect (
44
42
endpoint,
You can’t perform that action at this time.
0 commit comments