From 4d44d541f33bf176ba37b5445ba91a180ecc6234 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 15 Oct 2013 21:28:58 +0200 Subject: [PATCH] Re-implement ClusterListener::key_path. --- components/cluster/cluster-type.conf | 3 +++ components/cluster/clusterlistener.cpp | 11 ++++++++++- components/cluster/clusterlistener.h | 2 ++ doc/4.3-object-types.md | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/components/cluster/cluster-type.conf b/components/cluster/cluster-type.conf index 0c35ddded..aa05d15f9 100644 --- a/components/cluster/cluster-type.conf +++ b/components/cluster/cluster-type.conf @@ -21,6 +21,9 @@ type ClusterListener { %attribute string "cert_path", %require "cert_path", + %attribute string "key_path", + %require "key_path", + %attribute string "ca_path", %require "ca_path", diff --git a/components/cluster/clusterlistener.cpp b/components/cluster/clusterlistener.cpp index e81fc0b03..670cf1c0f 100644 --- a/components/cluster/clusterlistener.cpp +++ b/components/cluster/clusterlistener.cpp @@ -60,7 +60,7 @@ void ClusterListener::Start(void) if (!self) BOOST_THROW_EXCEPTION(std::invalid_argument("No configuration available for the local endpoint.")); - m_SSLContext = MakeSSLContext(GetCertificateFile(), GetCertificateFile(), GetCAFile()); + m_SSLContext = MakeSSLContext(GetCertificateFile(), GetKeyFile(), GetCAFile()); /* create the primary JSON-RPC listener */ if (!GetBindPort().IsEmpty()) @@ -134,6 +134,13 @@ String ClusterListener::GetCertificateFile(void) const return m_CertPath; } +String ClusterListener::GetKeyFile(void) const +{ + ObjectLock olock(this); + + return m_KeyPath; +} + String ClusterListener::GetCAFile(void) const { ObjectLock olock(this); @@ -1568,6 +1575,7 @@ void ClusterListener::InternalSerialize(const Dictionary::Ptr& bag, int attribut if (attributeTypes & Attribute_Config) { bag->Set("cert_path", m_CertPath); + bag->Set("key_path", m_KeyPath); bag->Set("ca_path", m_CAPath); bag->Set("bind_host", m_BindHost); bag->Set("bind_port", m_BindPort); @@ -1584,6 +1592,7 @@ void ClusterListener::InternalDeserialize(const Dictionary::Ptr& bag, int attrib if (attributeTypes & Attribute_Config) { m_CertPath = bag->Get("cert_path"); + m_KeyPath = bag->Get("key_path"); m_CAPath = bag->Get("ca_path"); m_BindHost = bag->Get("bind_host"); m_BindPort = bag->Get("bind_port"); diff --git a/components/cluster/clusterlistener.h b/components/cluster/clusterlistener.h index 4405942eb..a057880c6 100644 --- a/components/cluster/clusterlistener.h +++ b/components/cluster/clusterlistener.h @@ -48,6 +48,7 @@ public: virtual void Stop(void); String GetCertificateFile(void) const; + String GetKeyFile(void) const; String GetCAFile(void) const; String GetBindHost(void) const; String GetBindPort(void) const; @@ -63,6 +64,7 @@ protected: private: String m_CertPath; + String m_KeyPath; String m_CAPath; String m_BindHost; String m_BindPort; diff --git a/doc/4.3-object-types.md b/doc/4.3-object-types.md index 659cf9c67..9162ce21d 100644 --- a/doc/4.3-object-types.md +++ b/doc/4.3-object-types.md @@ -621,6 +621,7 @@ Attributes: Name |Description ----------------|---------------- cert\_path |TODO + key\_path |TODO ca\_path |TODO bind\_host |TODO bind\_port |TODO