/hg/release/icedtea-web-1.7: Added possibility to turn off https...

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Tue Dec 12 14:13:40 UTC 2017


changeset a33238cd2d00 in /hg/release/icedtea-web-1.7
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.7?cmd=changeset;node=a33238cd2d00
author: Jiri Vanek <jvanek at redhat.com>
date: Tue Dec 12 15:13:04 2017 +0100

	Added possibility to turn off https preference via deployment properties

	* netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java: if deployment.https.noenforce is true, then https variants are not smuggled into urlslist
	* netx/net/sourceforge/jnlp/config/Defaults.java: deployment.https.noenforce declared as false by default
	* netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: added field of KEY_HTTPS_DONT_ENFORCE = "deployment.https.noenforce"


diffstat:

 ChangeLog                                                     |  10 +++++
 netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java       |  21 ++++++----
 netx/net/sourceforge/jnlp/config/Defaults.java                |   7 +++-
 netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java |   3 +
 4 files changed, 32 insertions(+), 9 deletions(-)

diffs (85 lines):

diff -r 629814c226ea -r a33238cd2d00 ChangeLog
--- a/ChangeLog	Thu Jul 20 18:12:31 2017 +0200
+++ b/ChangeLog	Tue Dec 12 15:13:04 2017 +0100
@@ -1,3 +1,13 @@
+2017-12-08  Jiri Vanek <jvanek at redhat.com>
+
+	Added possibility to turn off https preference via deployment properties
+	* netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java:
+	if deployment.https.noenforce is true, then https variants are not smuggled into urlslist
+	* netx/net/sourceforge/jnlp/config/Defaults.java:
+	deployment.https.noenforce declared as false by default
+	* netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java:
+	added field of KEY_HTTPS_DONT_ENFORCE = "deployment.https.noenforce"
+
 2017-07-20  Jiri Vanek <jvanek at redhat.com>
 
 	Post-release changes
diff -r 629814c226ea -r a33238cd2d00 netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java
--- a/netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java	Thu Jul 20 18:12:31 2017 +0200
+++ b/netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java	Tue Dec 12 15:13:04 2017 +0100
@@ -42,6 +42,8 @@
 import java.util.List;
 
 import net.sourceforge.jnlp.DownloadOptions;
+import net.sourceforge.jnlp.config.DeploymentConfiguration;
+import net.sourceforge.jnlp.runtime.JNLPRuntime;
 import net.sourceforge.jnlp.util.logging.OutputController;
 
 public class ResourceUrlCreator {
@@ -95,14 +97,17 @@
 
         urls.add(resource.getLocation());
 
-        //preffering https and  owerriding case, when applciation was moved to https, but the jnlp stayed intacted
-        List<URL> urlsCopy = new LinkedList<>(urls);
-        for (URL u : urlsCopy) {
-            if (u.getProtocol().equals("http")) {
-                try {
-                    urls.add(0, copyUrltoHttps(u));
-                } catch (Exception ex) {
-                    OutputController.getLogger().log(ex);
+        boolean noHttpsPreffered = Boolean.valueOf(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_HTTPS_DONT_ENFORCE));
+        if (!noHttpsPreffered) {
+            //preffering https and  owerriding case, when applciation was moved to https, but the jnlp stayed intacted
+            List<URL> urlsCopy = new LinkedList<>(urls);
+            for (URL u : urlsCopy) {
+                if (u.getProtocol().equals("http")) {
+                    try {
+                        urls.add(0, copyUrltoHttps(u));
+                    } catch (Exception ex) {
+                        OutputController.getLogger().log(ex);
+                    }
                 }
             }
         }
diff -r 629814c226ea -r a33238cd2d00 netx/net/sourceforge/jnlp/config/Defaults.java
--- a/netx/net/sourceforge/jnlp/config/Defaults.java	Thu Jul 20 18:12:31 2017 +0200
+++ b/netx/net/sourceforge/jnlp/config/Defaults.java	Tue Dec 12 15:13:04 2017 +0100
@@ -220,7 +220,12 @@
                         BasicValueValidators.getBooleanValidator(),
                         String.valueOf(true)
                 },
-                                {
+                {
+                        DeploymentConfiguration.KEY_HTTPS_DONT_ENFORCE,
+                        BasicValueValidators.getBooleanValidator(),
+                        String.valueOf(false)
+                },
+                {
                         DeploymentConfiguration.KEY_SECURITY_PROMPT_USER_FOR_JNLP,
                         BasicValueValidators.getBooleanValidator(),
                         String.valueOf(true)
diff -r 629814c226ea -r a33238cd2d00 netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
--- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java	Thu Jul 20 18:12:31 2017 +0200
+++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java	Tue Dec 12 15:13:04 2017 +0100
@@ -151,6 +151,9 @@
     public static final String KEY_SECURITY_INSTALL_AUTHENTICATOR = "deployment.security.authenticator";
 
     public static final String KEY_STRICT_JNLP_CLASSLOADER = "deployment.jnlpclassloader.strict";
+    
+    /** Boolean. Do not prefere https over http */
+    public static final String KEY_HTTPS_DONT_ENFORCE = "deployment.https.noenforce";
     /*
      * Networking
      */


More information about the distro-pkg-dev mailing list