2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[#1706] Made TLS context public

This commit is contained in:
Francis Dupont
2021-04-20 16:58:08 +02:00
parent 3b57bf0101
commit a208db5be5
2 changed files with 7 additions and 7 deletions

View File

@@ -334,7 +334,7 @@ HAConfig::validate() {
<< " is missing or empty: all or none of"
<< " TLS parameters must be set");
}
TlsContext::configure(p->second->getTlsContextNonConst(),
TlsContext::configure(p->second->tls_context_,
TlsRole::CLIENT,
ca.get(),
cert.get(),

View File

@@ -141,11 +141,6 @@ public:
return (tls_context_);
}
/// @brief Returns a non-const pointer to the server's TLS context.
asiolink::TlsContextPtr& getTlsContextNonConst() {
return (tls_context_);
}
/// @brief Returns a string identifying a server used in logging.
///
/// The label is constructed from server name and server URL.
@@ -212,6 +207,12 @@ public:
/// when credentials are specified.
void addBasicAuthHttpHeader(http::PostHttpRequestJsonPtr request) const;
/// @brief Server TLS context.
///
/// @note: if you make it protected or private please make
/// @ref validate a friend so it may configure it.
asiolink::TlsContextPtr tls_context_;
private:
std::string name_; ///< Server name.
@@ -219,7 +220,6 @@ public:
util::Optional<std::string> trust_anchor_; ///< Server trust anchor.
util::Optional<std::string> cert_file_; ///< Server cert file.
util::Optional<std::string> key_file_; ///< Server key file.
asiolink::TlsContextPtr tls_context_; ///< Server TLS context.
Role role_; ///< Server role.
bool auto_failover_; ///< Auto failover state.
http::BasicHttpAuthPtr basic_auth_; ///< Basic HTTP authentication.