Skip to content

Commit 44e3399

Browse files
committed
Simplify certificate handling.
1 parent eb04cd1 commit 44e3399

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/worker.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020
#include <cstdint>
2121
#include <vector>
22+
#include <czmq++/czmqpp.hpp>
2223
#include <bitcoin/bitcoin.hpp>
2324
#include "echo.hpp"
2425
#include "worker.hpp"
@@ -107,10 +108,9 @@ void request_worker::enable_crypto(settings_type& config)
107108
std::string client_certs(CURVE_ALLOW_ANY);
108109
if (!config.client_certs_path.empty())
109110
client_certs = config.client_certs_path.generic_string();
110-
auto cert = czmqpp::load_cert(config.cert_file.generic_string());
111111
auth_.configure_curve("*", client_certs);
112-
cert_.reset(cert);
113-
cert_.apply(socket_);
112+
czmqpp::certificate cert(config.cert_file.generic_string());
113+
cert.apply(socket_);
114114
socket_.set_curve_server(zmq_curve_enabled);
115115
}
116116
void request_worker::create_new_socket(settings_type& config)

src/worker.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class request_worker
7777
czmqpp::context context_;
7878
// Main socket.
7979
czmqpp::socket socket_;
80-
czmqpp::certificate cert_;
8180
czmqpp::authenticator auth_;
8281
// Socket to trigger wakeup for send.
8382
czmqpp::socket wakeup_socket_;

0 commit comments

Comments
 (0)