diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html index 6ae0ab39b..dacc4fd97 100644 --- a/htroot/ConfigBasic.html +++ b/htroot/ConfigBasic.html @@ -92,7 +92,8 @@
- +     + with SSL (https enabled)
#(upnp)#::
@@ -124,7 +125,7 @@

You did not open a port in your firewall or your router does not forward the server port to your peer. This is needed if you want to fully participate in the YaCy network. You can also use your peer without opening it, but this is not recomended.

:: -

The peer port was changed successfully. Your browser will be redirected to the new location in 10 seconds.

+

The peer port was changed successfully. Your browser will be redirected to the new location in 5 seconds.

#(/nextStep)# #%env/templates/footer.template%# diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java index 2306954d1..14f7bbf61 100644 --- a/htroot/ConfigBasic.java +++ b/htroot/ConfigBasic.java @@ -94,10 +94,13 @@ public class ConfigBasic { // port settings final long port; + boolean ssl; if (post != null && post.getInt("port", 0) > 1023) { port = post.getLong("port", 8090); + ssl = post.getBoolean("withssl", false); } else { port = env.getConfigLong("port", 8090); //this allows a low port, but it will only get one, if the user edits the config himself. + ssl = env.getConfigBool("server.https", false); } // check if peer name already exists @@ -124,12 +127,13 @@ public class ConfigBasic { upnp = false; } - // check port + // check port and ssl connection final boolean reconnect; - if (!(env.getConfigLong("port", port) == port)) { + if (!(env.getConfigLong("port", port) == port) || env.getConfigBool("server.https", false) != ssl) { // validate port final serverCore theServerCore = (serverCore) env.getThread("10_httpd"); env.setConfig("port", port); + env.setConfig("server.https", ssl); // redirect the browser to the new port reconnect = true; @@ -160,8 +164,8 @@ public class ConfigBasic { //yacyAccessible.setNewPortBat(Integer.parseInt(port)); //yacyAccessible.setNewPortLink(Integer.parseInt(port)); - // force reconnection in 7 seconds - theServerCore.reconnect(7000); + // force reconnection in 5 seconds + theServerCore.reconnect(5000); } else { reconnect = false; prop.put("reconnect", "0"); @@ -263,6 +267,7 @@ public class ConfigBasic { // set default values prop.putHTML("defaultName", sb.peers.mySeed().getName()); prop.putHTML("defaultPort", env.getConfig("port", "8090")); + prop.put("withsslenabled", env.getConfigBool("server.https", false) ? 1 : 0); lang = env.getConfig("locale.language", "default"); // re-assign lang, may have changed prop.put("lang_de", "0"); prop.put("lang_fr", "0");