Re-implement ClusterListener::key_path.

This commit is contained in:
Gunnar Beutner 2013-10-15 21:28:58 +02:00
parent a03c58f27e
commit 4d44d541f3
4 changed files with 16 additions and 1 deletions

View File

@ -21,6 +21,9 @@ type ClusterListener {
%attribute string "cert_path", %attribute string "cert_path",
%require "cert_path", %require "cert_path",
%attribute string "key_path",
%require "key_path",
%attribute string "ca_path", %attribute string "ca_path",
%require "ca_path", %require "ca_path",

View File

@ -60,7 +60,7 @@ void ClusterListener::Start(void)
if (!self) if (!self)
BOOST_THROW_EXCEPTION(std::invalid_argument("No configuration available for the local endpoint.")); 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 */ /* create the primary JSON-RPC listener */
if (!GetBindPort().IsEmpty()) if (!GetBindPort().IsEmpty())
@ -134,6 +134,13 @@ String ClusterListener::GetCertificateFile(void) const
return m_CertPath; return m_CertPath;
} }
String ClusterListener::GetKeyFile(void) const
{
ObjectLock olock(this);
return m_KeyPath;
}
String ClusterListener::GetCAFile(void) const String ClusterListener::GetCAFile(void) const
{ {
ObjectLock olock(this); ObjectLock olock(this);
@ -1568,6 +1575,7 @@ void ClusterListener::InternalSerialize(const Dictionary::Ptr& bag, int attribut
if (attributeTypes & Attribute_Config) { if (attributeTypes & Attribute_Config) {
bag->Set("cert_path", m_CertPath); bag->Set("cert_path", m_CertPath);
bag->Set("key_path", m_KeyPath);
bag->Set("ca_path", m_CAPath); bag->Set("ca_path", m_CAPath);
bag->Set("bind_host", m_BindHost); bag->Set("bind_host", m_BindHost);
bag->Set("bind_port", m_BindPort); bag->Set("bind_port", m_BindPort);
@ -1584,6 +1592,7 @@ void ClusterListener::InternalDeserialize(const Dictionary::Ptr& bag, int attrib
if (attributeTypes & Attribute_Config) { if (attributeTypes & Attribute_Config) {
m_CertPath = bag->Get("cert_path"); m_CertPath = bag->Get("cert_path");
m_KeyPath = bag->Get("key_path");
m_CAPath = bag->Get("ca_path"); m_CAPath = bag->Get("ca_path");
m_BindHost = bag->Get("bind_host"); m_BindHost = bag->Get("bind_host");
m_BindPort = bag->Get("bind_port"); m_BindPort = bag->Get("bind_port");

View File

@ -48,6 +48,7 @@ public:
virtual void Stop(void); virtual void Stop(void);
String GetCertificateFile(void) const; String GetCertificateFile(void) const;
String GetKeyFile(void) const;
String GetCAFile(void) const; String GetCAFile(void) const;
String GetBindHost(void) const; String GetBindHost(void) const;
String GetBindPort(void) const; String GetBindPort(void) const;
@ -63,6 +64,7 @@ protected:
private: private:
String m_CertPath; String m_CertPath;
String m_KeyPath;
String m_CAPath; String m_CAPath;
String m_BindHost; String m_BindHost;
String m_BindPort; String m_BindPort;

View File

@ -621,6 +621,7 @@ Attributes:
Name |Description Name |Description
----------------|---------------- ----------------|----------------
cert\_path |TODO cert\_path |TODO
key\_path |TODO
ca\_path |TODO ca\_path |TODO
bind\_host |TODO bind\_host |TODO
bind\_port |TODO bind\_port |TODO