mirror of https://github.com/Icinga/icinga2.git
SSL bugfixes.
This commit is contained in:
parent
55e8619b76
commit
fa9449fc73
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
|
||||
virtual void Start(void);
|
||||
|
||||
virtual bool WantsToRead(void) const;
|
||||
virtual bool WantsToWrite(void) const;
|
||||
|
||||
Event<VerifyCertificateEventArgs> OnVerifyCertificate;
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue