mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
https: use identity's certificate chain
This commit is contained in:
1 parent
8856a70af5
commit
ab7f36ff85
1 file changed
+2
-3
+2
-3
@@ -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_)
|
||||
|
||||
Reference in new issue
Block a user