diff --git a/core/src/lib/tls.h b/core/src/lib/tls.h index 196ebfae32c..be26db6f1ba 100644 --- a/core/src/lib/tls.h +++ b/core/src/lib/tls.h @@ -72,7 +72,7 @@ class Tls { virtual std::string TlsCipherGetName() const { return std::string(); } virtual void SetCipherList(const std::string& cipherlist) = 0; - virtual void SetProtocol(std::string version) = 0; + virtual void SetProtocol(const std::string& version) = 0; virtual void Setca_certfile_(const std::string& ca_certfile) = 0; virtual void SetCaCertdir(const std::string& ca_certdir) = 0; diff --git a/core/src/lib/tls_openssl.cc b/core/src/lib/tls_openssl.cc index 4d269034a8a..38d86d4c40c 100644 --- a/core/src/lib/tls_openssl.cc +++ b/core/src/lib/tls_openssl.cc @@ -27,6 +27,7 @@ #include #include "include/bareos.h" +#include "include/make_unique.h" #include "lib/bpoll.h" #include "lib/crypto_openssl.h" @@ -47,7 +48,7 @@ #include "parse_conf.h" -TlsOpenSsl::TlsOpenSsl() : d_(new TlsOpenSslPrivate) {} +TlsOpenSsl::TlsOpenSsl() : d_(std::make_unique()) {} TlsOpenSsl::~TlsOpenSsl() = default; diff --git a/core/src/lib/tls_openssl.h b/core/src/lib/tls_openssl.h index 0e2c7a54f97..0e3d444dde6 100644 --- a/core/src/lib/tls_openssl.h +++ b/core/src/lib/tls_openssl.h @@ -50,7 +50,7 @@ class TlsOpenSsl : public Tls { std::string TlsCipherGetName() const override; void SetCipherList(const std::string& cipherlist) override; - void SetProtocol(std::string protocol) override; + void SetProtocol(const std::string& protocol) override; void TlsLogConninfo(JobControlRecord* jcr, const char* host, int port, diff --git a/core/src/lib/tls_openssl_private.cc b/core/src/lib/tls_openssl_private.cc index ad359a4348f..44f9ec26dcf 100644 --- a/core/src/lib/tls_openssl_private.cc +++ b/core/src/lib/tls_openssl_private.cc @@ -610,7 +610,7 @@ void TlsOpenSsl::SetCipherList(const std::string& cipherlist) d_->cipherlist_ = cipherlist; } -void TlsOpenSsl::SetProtocol(std::string protocol) +void TlsOpenSsl::SetProtocol(const std::string& protocol) { Dmsg1(100, "Set protocol:\t<%s>\n", protocol.c_str()); d_->protocol_ = protocol;