diff --git a/htroot/ConfigNetwork_p.html b/htroot/ConfigNetwork_p.html index d55ed6928..218cd2c1e 100644 --- a/htroot/ConfigNetwork_p.html +++ b/htroot/ConfigNetwork_p.html @@ -218,6 +218,32 @@ + +
+ +
+ + + +
+
Protocol operations encryption
+
+ +

When TLS/SSL is enabled on remote peers, it should be used to encrypt outgoing communications with them (for operations such as network presence, index transfer, remote crawl...). + Please note that contrary to strict TLS, certificates are not validated against trusted certificate authorities (CA), thus allowing YaCy peers to use self-signed certificates. +

+

Note also that encryption of remote search queries is configured with a dedicated setting in the Config Portal page.

+
+
+
+ +
+
+
+
#%env/templates/footer.template%# diff --git a/htroot/ConfigNetwork_p.java b/htroot/ConfigNetwork_p.java index 91484c891..39b7aada7 100644 --- a/htroot/ConfigNetwork_p.java +++ b/htroot/ConfigNetwork_p.java @@ -91,6 +91,26 @@ public class ConfigNetwork_p sb.switchNetwork(networkDefinition); } } + + if (post.containsKey("setEncryption")) { + /* + * Settings will be modified : check this is a valid transaction using HTTP POST + * method + */ + TransactionManager.checkPostTransaction(header, post); + + final boolean httpsPreferred = sb.getConfigBool(SwitchboardConstants.NETWORK_PROTOCOL_HTTPS_PREFERRED, + SwitchboardConstants.NETWORK_PROTOCOL_HTTPS_PREFERRED_DEFAULT); + final boolean newHttpsPreferred = post + .getBoolean(SwitchboardConstants.NETWORK_PROTOCOL_HTTPS_PREFERRED); + if (httpsPreferred == newHttpsPreferred) { + // no change + commit = 3; + } else { + commit = 1; + sb.setConfig(SwitchboardConstants.NETWORK_PROTOCOL_HTTPS_PREFERRED, newHttpsPreferred); + } + } if ( post.containsKey("save") ) { /* Settings will be modified : check this is a valid transaction using HTTP POST method */ @@ -211,6 +231,11 @@ public class ConfigNetwork_p prop.put("networks_" + c++ + "_network", s); } prop.put("networks", c); + + // set encryption setting + prop.put(SwitchboardConstants.NETWORK_PROTOCOL_HTTPS_PREFERRED, + sb.getConfigBool(SwitchboardConstants.NETWORK_PROTOCOL_HTTPS_PREFERRED, + SwitchboardConstants.NETWORK_PROTOCOL_HTTPS_PREFERRED_DEFAULT)); return prop; }