From: <ma...@us...> - 2009-11-20 23:06:32
|
Revision: 3251 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3251&view=rev Author: matzon Date: 2009-11-20 23:06:24 +0000 (Fri, 20 Nov 2009) Log Message: ----------- workaround for missing certificate for AppletLoader if cached Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2009-11-15 21:36:49 UTC (rev 3250) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2009-11-20 23:06:24 UTC (rev 3251) @@ -54,6 +54,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.net.HttpURLConnection; +import java.net.JarURLConnection; import java.net.SocketPermission; import java.net.URL; import java.net.URLClassLoader; @@ -1045,6 +1046,16 @@ // get the current certificate to compare against native files Certificate[] certificate = AppletLoader.class.getProtectionDomain().getCodeSource().getCertificates(); + + // workaround for bug where cached applet loader does not have certificates!? + if (certificate == null) { + URL location = AppletLoader.class.getProtectionDomain().getCodeSource().getLocation(); + + // manually load the certificate + JarURLConnection jurl = (JarURLConnection) (new URL("jar:" + location.toString() + "!/org/lwjgl/util/applet/AppletLoader.class").openConnection()); + jurl.setDefaultUseCaches(true); + certificate = jurl.getCertificates(); + } // create native folder File nativeFolder = new File(path + "natives"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |