RE: HTTPS from Orion Java Bean
Are you using the exact same JDK in both cases? With the exact same libraries? We had some trouble with Weblogic always using their implementation of ssl and used the following to override it: if(url.indexOf("https")!=-1){ URLStreamHandler h =(URLStreamHandler) new com.sun.net.ssl.internal.www.protocol.https.Handler(); sparBankenURL = new URL(null,url,h); } plus of course: the jsse.jar in the classpath and associated entries in the $JAVA_HOME/jre/lib/security/java.security file. I am not saying you should do it like this but it is nicer as it throws "ClassNotFoundExceptions" instead of "no implementation found". /korre -Original Message- From: Tim Endres To: Orion-Interest Cc: Geoff Marshall Sent: 2001-02-06 02:25 Subject: Re: HTTPS from Orion Java Bean Since I have no code, I can only guess... Sounds to me like you are getting a different URLConnection subclass in the two cases. I would try to print out the connection that you are getting to see what it is. Then you will need to see if you can correct the problem from there. tim. Hello all! I've written a bean that calls a credit card processing gateway from a Java bean. It is very simple and executes an https://... request. Then it reads the entire contents of the web page. And it works if I run my AuthBean class from the command line. But when I attempt to use AuthBean, calling it from an Orion JSP, I get a runtime error: SSL not implemented. So I looked at all I did to enable the j2sdkee1.2.1 to work with SSL and tried to somehow apply that to Orion, but I came up blank. I read through the SSL help page and it doesn't seem to address the problem I'm having. Any help would be appreciated! -- -Geoff Marshall, Director of Development ... t e r r a s c o p e (415) 951-4944 54 Mint Street, Suite 110 direct (415) 625-0349 San Francisco, CA 94103 fax (415) 625-0306 ...
Re: HTTPS from Orion Java Bean
Tim- Thanks for responding. I need to learn to write these messages a little more clearly. Basically, I downloaded the JSSE stuff from Sun and tweaked the J2sdkee1.2.1 to allow me access to the SSL routines as per Sun's instructions. I compiled the Java class and executed it (see below). It runs, so I know it's not the code that has the problem. When I bring it into Orion as a class instantiated by a jsp:usebean tag, I then get the error message. So I'm thinking I need to apply the JSSE stuff to Orion in some way, and I can find no information on how to do that... -- -Geoff Marshall, Director of Development ... t e r r a s c o p e (415) 951-4944 54 Mint Street, Suite 110 direct (415) 625-0349 San Francisco, CA 94103 fax (415) 625-0306 ... import java.io.*; import java.net.*; import java.util.*; import javax.servlet.http.*; import java.text.*; // Take a credit card transaction and interact with the authorization // company. Get an authorization. Parse return. Store it in the database. Handle errors. // decide which page to display. // call this with all the parameters on the url... public class AuthBean { // authorization object // consists of information regarding requested transaction // and response from that transaction. private String authURL; public AuthBean() { System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.ww w.protocol"); this.authURL = "https://www.verisign.com/" } public void setGateway(String gateway) { this.authURL = gateway; } public String authorize(String parms) throws Exception { URL gateway = new URL(this.authURL + "?" + parms); BufferedReader in = new BufferedReader(new InputStreamReader(gateway.openStream())); String inputLine=null, authorization=""; while ((inputLine = in.readLine()) != null) authorization = authorization + inputLine; in.close(); return authorization; } public static void main(String args[]) { AuthBean ab = new AuthBean(); try { System.out.println(ab.authorize("test")); } catch(Exception e) { System.out.println("EXCEPTION:" + e); } } }
Re: HTTPS from Orion Java Bean
Since I have no code, I can only guess... Sounds to me like you are getting a different URLConnection subclass in the two cases. I would try to print out the connection that you are getting to see what it is. Then you will need to see if you can correct the problem from there. tim. Hello all! I've written a bean that calls a credit card processing gateway from a Java bean. It is very simple and executes an https://... request. Then it reads the entire contents of the web page. And it works if I run my AuthBean class from the command line. But when I attempt to use AuthBean, calling it from an Orion JSP, I get a runtime error: SSL not implemented. So I looked at all I did to enable the j2sdkee1.2.1 to work with SSL and tried to somehow apply that to Orion, but I came up blank. I read through the SSL help page and it doesn't seem to address the problem I'm having. Any help would be appreciated! -- -Geoff Marshall, Director of Development ... t e r r a s c o p e (415) 951-4944 54 Mint Street, Suite 110 direct (415) 625-0349 San Francisco, CA 94103 fax (415) 625-0306 ...