Merge pull request #1277 from xnrand/master

Add network-specific settings for cert validation
This commit is contained in:
Alexey Sokolov
2016-08-20 12:08:41 +01:00
committed by GitHub
8 changed files with 69 additions and 2 deletions
+8
View File
@@ -266,6 +266,12 @@ class CIRCNetwork {
m_uJoinDelay = uJoinDelay;
}
void SetTrustAllCerts(const bool bTrustAll = false) { m_bTrustAllCerts = bTrustAll; }
bool GetTrustAllCerts() const { return m_bTrustAllCerts; }
void SetTrustPKI(const bool bTrustPKI = true) { m_bTrustPKI = bTrustPKI; }
bool GetTrustPKI() const { return m_bTrustPKI; }
unsigned long long BytesRead() const { return m_uBytesRead; }
unsigned long long BytesWritten() const { return m_uBytesWritten; }
@@ -305,6 +311,8 @@ class CIRCNetwork {
CString m_sChanPrefixes;
bool m_bIRCConnectEnabled;
bool m_bTrustAllCerts;
bool m_bTrustPKI;
CString m_sIRCServer;
std::vector<CServer*> m_vServers;
size_t m_uServerIdx; ///< Index in m_vServers of our current server + 1
+8
View File
@@ -46,6 +46,12 @@ class CZNCSock : public Csock, public CCoreTranslationMixin {
m_ssTrustedFingerprints = ssFPs;
}
void SetTrustAllCerts(const bool bTrustAll = false) { m_bTrustAllCerts = bTrustAll; }
bool GetTrustAllCerts() const { return m_bTrustAllCerts; }
void SetTrustPKI(const bool bTrustPKI = true) { m_bTrustPKI = bTrustPKI; }
bool GetTrustPKI() const { return m_bTrustPKI; }
void SetEncoding(const CString&);
virtual CString GetRemoteIP() const { return Csock::GetRemoteIP(); }
@@ -60,6 +66,8 @@ class CZNCSock : public Csock, public CCoreTranslationMixin {
CString m_sHostToVerifySSL;
SCString m_ssTrustedFingerprints;
SCString m_ssCertVerificationErrors;
bool m_bTrustAllCerts;
bool m_bTrustPKI;
};
enum EAddrType { ADDR_IPV4ONLY, ADDR_IPV6ONLY, ADDR_ALL };