]> granicus.if.org Git - icinga2/commitdiff
SSL bugfixes.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 24 Apr 2012 14:27:23 +0000 (16:27 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 24 Apr 2012 14:27:23 +0000 (16:27 +0200)
base/tlsclient.cpp
base/tlsclient.h
icinga-app/icinga.conf
icinga/jsonrpcendpoint.cpp

index d8984e5080c5350bc7cc520270cc58b71f090d7e..f51360ce0edd94b75bcdfc1d68c36ed4336cf8fc 100644 (file)
@@ -116,14 +116,19 @@ int TLSClient::WritableEventHandler(const EventArgs& ea)
        return 0;
 }
 
+bool TLSClient::WantsToRead(void) const
+{
+       if (SSL_want_read(m_SSL.get()))
+               return true;
+
+       return TCPClient::WantsToWrite();
+}
+
 bool TLSClient::WantsToWrite(void) const
 {
        if (SSL_want_write(m_SSL.get()))
                return true;
 
-       if (SSL_state(m_SSL.get()) != SSL_ST_OK)
-               return false;
-
        return TCPClient::WantsToWrite();
 }
 
index e441293c6e01397ca0e26d6e14a8c25cc0a639be..5614f27e78082a70a3441ec6341e78d5bfe8ffd2 100644 (file)
@@ -40,6 +40,7 @@ public:
 
        virtual void Start(void);
 
+       virtual bool WantsToRead(void) const;
        virtual bool WantsToWrite(void) const;
 
        Event<VerifyCertificateEventArgs> OnVerifyCertificate;
index 6af0fa60f53c666182812023422012e92fd9f825..38d761f359fcdbb8b17fbc6e6061ffded69d83b2 100644 (file)
@@ -3,8 +3,8 @@
                "configrpc": { "replicate": "0", "configSource": "1" },
                "demo": { "replicate": "0" }
        },
-       "rpclistener": {
-               "kekslistener": { "replicate": "0", "port": "7777" }
+       "rpcconnection": {
+               "kekslistener": { "replicate": "0", "hostname": "10.0.10.14", "port": "7777" }
        },
        "host": {
                "localhost": { "ipaddr": "127.0.0.1" }
index 63590f8b44264f4aeffc92c93cbf50b09c2d7db4..9a51fde28ddc87147bc72b6d50dc9c1ec6811989 100644 (file)
@@ -189,8 +189,12 @@ int JsonRpcEndpoint::ClientReconnectHandler(const TimerEventArgs& ea)
 
 int JsonRpcEndpoint::VerifyCertificateHandler(const VerifyCertificateEventArgs& ea)
 {
-       if (ea.Certificate && ea.ValidCertificate)
-               SetIdentity(Utility::GetCertificateCN(ea.Certificate));
+       if (ea.Certificate && ea.ValidCertificate) {
+               string identity = Utility::GetCertificateCN(ea.Certificate);
+
+               if (GetIdentity().empty() && !identity.empty())
+                       SetIdentity(identity);
+       }
 
        return 0;
 }