https: use identity's certificate chain

This commit is contained in:
Seva authored and Adrien Béraud committed 2019-10-15 14:34:50 -04:00
1 parent 8856a70af5
commit ab7f36ff85
1 file changed
+2 -3
+2 -3
View File
@@ -120,9 +120,8 @@ Connection::Connection(asio::io_context& ctx, std::shared_ptr<dht::crypto::Certi
throw std::runtime_error("Error setting client private key: " + ec.message());
}
if (identity.second){
auto cert = identity.second->toString(false/*chain*/);
ssl_ctx_->use_certificate(asio::const_buffer{cert.data(), cert.size()},
asio::ssl::context::file_format::pem, ec);
auto cert = identity.second->toString(true/*chain*/);
ssl_ctx_->use_certificate_chain(asio::const_buffer{cert.data(), cert.size()}, ec);
if (ec)
throw std::runtime_error("Error adding client certificate: " + ec.message());
else if (logger_)