2 more plugin fixes
Deepak Bhole
dbhole at redhat.com
Thu Apr 23 14:01:16 PDT 2009
Attached patch fixes two more issues from rhbz:
480075 - javaws not working with ssl properly
483095 - Applet not loading correctly
ChangeLog entry:
* plugin/icedtea/sun/applet/PluginAppletViewer.java: Unescape "
* rt/net/sourceforge/jnlp/runtime/Boot.java: Use custom authenticator for
javaws, so that it can handle SSL sites correctly
Deepak
-------------- next part --------------
diff -r 46128f71ec57 plugin/icedtea/sun/applet/PluginAppletViewer.java
--- a/plugin/icedtea/sun/applet/PluginAppletViewer.java Thu Apr 23 14:35:50 2009 -0400
+++ b/plugin/icedtea/sun/applet/PluginAppletViewer.java Thu Apr 23 15:26:07 2009 -0400
@@ -1635,12 +1635,14 @@
att = att.replace("&", "&");
att = att.replace(" ", "\n");
att = att.replace(" ", "\r");
+ att = att.replace(""", "\"");
val = val.replace(">", ">");
val = val.replace("<", "<");
val = val.replace("&", "&");
val = val.replace(" ", "\n");
val = val.replace(" ", "\r");
+ val = val.replace(""", "\"");
PluginDebug.debug("PUT " + att + " = " + val);
atts.put(att.toLowerCase(), val);
} else {
@@ -1720,13 +1722,6 @@
if (atts.get("java_type") != null) {
atts.put("type", ((String) atts.get("java_type")));
}
-
- // The <OBJECT> attribute codebase isn't what
- // we want when not dealing with jars. If its
- // defined, remove it in that case.
- if(atts.get("archive") == null && atts.get("codebase") != null) {
- atts.remove("codebase");
- }
if (atts.get("width") == null || !isInt(atts.get("width"))) {
atts.put("width", "1000");
diff -r 46128f71ec57 rt/net/sourceforge/jnlp/runtime/Boot.java
--- a/rt/net/sourceforge/jnlp/runtime/Boot.java Thu Apr 23 14:35:50 2009 -0400
+++ b/rt/net/sourceforge/jnlp/runtime/Boot.java Thu Apr 23 15:26:07 2009 -0400
@@ -17,17 +17,32 @@
package net.sourceforge.jnlp.runtime;
-import java.util.*;
-import java.io.*;
-import java.net.*;
-import java.security.*;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.List;
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.cache.*;
-import net.sourceforge.jnlp.runtime.*;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+
+import net.sourceforge.jnlp.AppletDesc;
+import net.sourceforge.jnlp.ApplicationDesc;
+import net.sourceforge.jnlp.JNLPFile;
+import net.sourceforge.jnlp.LaunchException;
+import net.sourceforge.jnlp.Launcher;
+import net.sourceforge.jnlp.ParseException;
+import net.sourceforge.jnlp.PropertyDesc;
+import net.sourceforge.jnlp.ResourcesDesc;
+import net.sourceforge.jnlp.cache.UpdatePolicy;
+import net.sourceforge.jnlp.security.VariableX509TrustManager;
import net.sourceforge.jnlp.security.viewer.CertificateViewer;
-import net.sourceforge.jnlp.services.*;
-import net.sourceforge.jnlp.util.*;
+import net.sourceforge.jnlp.services.ServiceUtil;
/**
* This is the main entry point for the JNLP client. The main
@@ -153,6 +168,20 @@
if (null != getOption("-noupdate"))
JNLPRuntime.setDefaultUpdatePolicy(UpdatePolicy.NEVER);
+
+ // wire in custom authenticator
+ try {
+ SSLSocketFactory sslSocketFactory;
+ SSLContext context = SSLContext.getInstance("SSL");
+ TrustManager[] trust = new TrustManager[] { VariableX509TrustManager.getInstance() };
+ context.init(null, trust, null);
+ sslSocketFactory = context.getSocketFactory();
+
+ HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
+ } catch (Exception e) {
+ System.err.println("Unable to set SSLSocketfactory (may _prevent_ access to sites that should be trusted)! Continuing anyway...");
+ e.printStackTrace();
+ }
// do in a privileged action to clear the security context of
// the Boot13 class, which doesn't have any privileges in
More information about the distro-pkg-dev
mailing list