Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6227159

Can't create HTTPS URLs in applets when logged in as guest

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • deploy
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      When logged into windows as the user 'Guest' an ExceptionInInitializer exception is thrown when creating a URL object with the 'https' protocol.

      This seems to be caused by the native method generateSeed in com.sun.deploy.security.WSeedGenerator returning null.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the applet.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A valid URL object.
      ACTUAL -
      An exception is thrown.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.ExceptionInInitializerError
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Unknown Source)
              at java.net.URL.getURLStreamHandler(Unknown Source)
              at java.net.URL.<init>(Unknown Source)
              at java.net.URL.<init>(Unknown Source)
              at java.net.URL.<init>(Unknown Source)
              at HTTPSTest.init(HTTPSTest.java:87)
              at sun.applet.AppletPanel.run(Unknown Source)
              at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException
              at java.security.SecureRandom.nextBytes(Unknown Source)
              at java.security.SecureRandom.next(Unknown Source)
              at java.util.Random.nextInt(Unknown Source)
              at com.sun.deploy.net.protocol.https.Handler$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at com.sun.deploy.net.protocol.https.Handler.<clinit>(Unknown Source)
              ... 9 more

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.applet.Applet;
      import java.net.URL;
      import java.net.MalformedURLException;
      public class HTTPSTest extends Applet
      {

        public void init()
        {
          try
          {
            URL url = new URL("https://www.verisign.com/");
          }
          catch (MalformedURLException itsNot)
          {
          }
        }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I don't think there's a workaround unless the applet is signed.

      If it's signed you can force it to use Sun's implementation of the https handler either by adding the line:

      System.setProperty("java.protocol.handler.pkgs", "sun.net.www.protocol");

      before creating the URL object or by passing the handler to the constructor:

      URL url = new URL("https", "www.verisign.com", -1, "", new sun.net.www.protocol.https.Handler());
      ###@###.### 2005-2-09 12:15:20 GMT

            dgu Dennis Gu (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: