Skip to content

Commit 07aa9fd

Browse files
committed
Merge pull request cpp-netlib#481 from trent33/0.11-devel
Peer verification using OpenSSL environment variables
2 parents 7287548 + a3102e9 commit 07aa9fd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

boost/network/protocol/http/client/connection/ssl_delegate.ipp

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ void boost::network::http::impl::ssl_delegate::connect(
3434
context_->load_verify_file(*certificate_filename_);
3535
if (verify_path_) context_->add_verify_path(*verify_path_);
3636
} else {
37-
if (always_verify_peer_)
37+
if (always_verify_peer_) {
3838
context_->set_verify_mode(asio::ssl::context::verify_peer);
39+
context_->set_default_verify_paths(); // use openssl default verify paths. uses openssl environment variables SSL_CERT_DIR, SSL_CERT_FILE
40+
}
3941
else
4042
context_->set_verify_mode(asio::ssl::context::verify_none);
4143
}

boost/network/protocol/http/client/options.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ struct client_options {
9595
return *this;
9696
}
9797

98+
client_options& always_verify_peer(bool v) {
99+
always_verify_peer_ = v;
100+
return *this;
101+
}
102+
98103
client_options& timeout(int v) {
99104
timeout_ = v;
100105
return *this;

0 commit comments

Comments
 (0)