Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 9174 invoked from network); 7 Jan 2003 10:06:02 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 7 Jan 2003 10:06:02 -0000 Received: (qmail 6657 invoked by uid 97); 7 Jan 2003 10:06:38 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 6634 invoked by uid 97); 7 Jan 2003 10:06:37 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 11980 invoked by uid 98); 7 Jan 2003 09:15:13 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) From: "Hari" To: , Cc: Subject: Accessing Secured Site from within Tomcat. Date: Tue, 7 Jan 2003 14:41:05 +0530 Message-ID: <000401c2b62c$b613c380$820218ac@hari> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 1 (Highest) X-MSMail-Priority: High X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: High Disposition-Notification-To: "Hari" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Everyone! Greetings! I have a problems with Tomcat (4.0.4) while accessing a secured site from inside a JSP or Servlet. Please find the code (JSP) below. However, when I execute the code as a standalone Java Program, I get the expected result. But inside Tomcat, I get "unknown protocol: https" error. 1. I put the three jar files in common/lib folder of Tocmat. 2. I added the security provider. (com.sun.net.ssl.internal.ssl.Provider) 3. Set the required System properties. I expect you'll help me to get out this problem. Thanks and Regards, Hari. PS: Kindly CC me (harir@kumaran.com) in your replies as I'm not the subscriber to either list. Here is the Stack Trace: *----------------------* java.net.MalformedURLException: unknown protocol: https at java.net.URL.(URL.java:480) at java.net.URL.(URL.java:376) at java.net.URL.(URL.java:330) at org.apache.jsp.https$jsp._jspService(https$jsp.java:69) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) .. Here is the (simple) JSP code I use: *----------------------------------* <%@ page language="java" import="java.lang.*,java.net.*,java.util.*,HTTPClient.*" %> <% System.getProperties().put( "java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); System.getProperties().put( "javax.net.debug", "all"); System.getProperties().put( "javax.net.ssl.trustStore", "d:\\work\\ssl\\cacert.dat"); System.getProperties().put( "javax.net.ssl.trustStorePassword", "changeit"); java.security.Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider()); URL url = new URL( "https://prasanna/getProperties"); HTTPConnection con = new HTTPConnection( url); HTTPResponse rsp = con.Get( "/getProperties"); System.err.println( "Received Code: " + rsp.getStatusCode()); System.err.println( "Received Message: "+rsp.getReasonLine()); String data = rsp.getText(); System.err.println( data); %> <%= data %> -- To unsubscribe, e-mail: For additional commands, e-mail: