mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Add network-specific config for cert validation
Added the following two network-specific configuration options that can be changed via controlpanel or webadmin: * TrustAllCerts: Will trust ALL certificates when enabled, effectively disabling TLS certificate validation. Default value: false * TrustPKI: Whether or not to trust PKI-valid certificates. Setting this to false will make znc trust only trusted certificates added by the user. Default value: true With default values, behavior is exactly the same as before. This is based on the work of Roelf Wichertjes. See YourBNC/znc@5c747598. See znc/znc#866.
This commit is contained in:
@@ -937,6 +937,8 @@ class CWebAdminMod : public CModule {
|
||||
|
||||
Tmpl["IRCConnectEnabled"] =
|
||||
CString(pNetwork->GetIRCConnectEnabled());
|
||||
Tmpl["TrustAllCerts"] = CString(pNetwork->GetTrustAllCerts());
|
||||
Tmpl["TrustPKI"] = CString(pNetwork->GetTrustPKI());
|
||||
|
||||
breadNet["Text"] = f("Edit Network [{1}]")(pNetwork->GetName());
|
||||
|
||||
@@ -985,6 +987,8 @@ class CWebAdminMod : public CModule {
|
||||
Tmpl["Title"] =
|
||||
f("Add Network for User [{1}]")(pUser->GetUserName());
|
||||
Tmpl["IRCConnectEnabled"] = "true";
|
||||
Tmpl["TrustAllCerts"] = "false";
|
||||
Tmpl["TrustPKI"] = "true";
|
||||
Tmpl["FloodProtection"] = "true";
|
||||
Tmpl["FloodRate"] = "1.0";
|
||||
Tmpl["FloodBurst"] = "4";
|
||||
@@ -1076,6 +1080,9 @@ class CWebAdminMod : public CModule {
|
||||
|
||||
pNetwork->SetIRCConnectEnabled(WebSock.GetParam("doconnect").ToBool());
|
||||
|
||||
pNetwork->SetTrustAllCerts(WebSock.GetParam("trustallcerts").ToBool());
|
||||
pNetwork->SetTrustPKI(WebSock.GetParam("trustpki").ToBool());
|
||||
|
||||
sArg = WebSock.GetParam("bindhost");
|
||||
// To change BindHosts be admin or don't have DenySetBindHost
|
||||
if (spSession->IsAdmin() || !spSession->GetUser()->DenySetBindHost()) {
|
||||
|
||||
Reference in New Issue
Block a user