5 Replies Latest reply on May 9, 2012 10:55 PM by EJP

    Trouble connecting to SSL / TLS website via Java JDK - Why isn't it working

      Here is the important part. When compiled and run:
      String Urlx="https://domain.com" // valid URL that comes up fine in a web browser
      System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
      Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
      URL url = new URL(Urlx);
      in = url.openStream(); // Currently An IoException is thrown

      It appears an IoException is thrown: java.io.IOException: Server returned HTTP response code: 403 for URL: https://domain.com

      Does anyone know why this might be happening and what if anything is missing? e.g missing .jar file? A different way to accomplish this in Java JDK?

      What is happening here? Should I use wireshark to get mroe information about this? What java tools should I be using to get more information on why this is not working?
      I can compile the code shown above but that 403 error and IoException are very troubling!