File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes BEA/Weblogic and the fly likes SSL in Weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "SSL in Weblogic" Watch "SSL in Weblogic" New topic

SSL in Weblogic

masroor rizvi

Joined: Aug 20, 2003
Posts: 3
i am trying to connect to a payment gateway in my simple session bean using Weblogic 8.1 but it giving this error
com.datacash.client.errors.NetworkErrorReport: Network error FATAL Alert:HANDSHAKE_FAILURE - The
handshake handler was unable to negotiate an acceptable set of security paramet

does anyone have any idea how this error can be resolved...
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
Can you provide more info on "payment gateway" and how do you connect to it. Is it an ejb that you are invoking or is it a HTTP URL connection that is being created
masroor rizvi

Joined: Aug 20, 2003
Posts: 3
hi rahul,
thanks for the help....
previously i was trying it with a simple session bean using weblogic 8.1. Then i made a simple jsp and put that in an ear and tried that on weblogic. For this simple JSP also, its giving the same error. The payment gateway that i'm connecting is datacash and the url for that is "".I also tried a simple public static void main example from my command prompt which worked completely fine. Then on similar lines i made a JSP which failed completely. The code of jsp is giving below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page import="com.datacash.util.XMLDocument,
<TITLE>Simple JSP Page</TITLE>
<H2>Counting Fun</H2>
<%--<% for (int jj=1; jj<=10; jj++) { %>
<%= jj %><br>
<% } %>--%>
static final Random RANDOM = new Random(System.currentTimeMillis());
static String getRandomRef ( ) {
long merchantRef;
do {
merchantRef = Math.abs(RANDOM.nextLong()) % 1000000000000L;
} while ( merchantRef < 100000 );
return merchantRef + "";
String hostname = "";
Agent agent = new Agent();
String client = "99141400", password = "Jw9MPHW", cardInfoPath = null;
boolean runErrors;
//String usage = getUsage();
Logger logger = new Logger();
logger.addLogListener(new LogListener() {
public void log ( String string ) {
/* First, let's create and send a transaction by
* setting all of the fields directly. */
XMLDocument xmldoc1 = null;
try {
/* Create a new blank XMLDocument */
xmldoc1 = new XMLDocument();
/* Set your client and password details, for your
* test account */
xmldoc1.set("Request.Authentication.client", client);
xmldoc1.set("Request.Authentication.password", password);
/* Set some random merchant reference. Once you're live,
* you'll want to use something other than random, but it's
* good enough for the demonstration. */
xmldoc1.set("Request.Transaction.TxnDetails.merchantreference", getRandomRef());
/* Set an amount. You don't need to specify a currency if
* it is GBP, but we'll do so anyway to show you how to
* do it */
Hashtable amt = new Hashtable();
amt.put("currency", "GBP");
xmldoc1.set("Request.Transaction.TxnDetails.amount", "5.99", amt);
/* Now set the card number, expiry date and method */
xmldoc1.set("Request.Transaction.CardTxn.method", "auth");
/* Now, we create a new CardInfo object which checks the
* data that we have put into the XML Document */
CardInfo cardInfo = new CardInfo(cardInfoPath, logger);
System.out.println("value of card info object " + cardInfo);
/* We now attach the CardInfo object to the XMLDocument object */
/* Now we send the transaction to the server */
System.out.println("before request");
XMLDocument response2 = agent.request(xmldoc1, logger);
System.out.println("after request");
/* That's all there is to it, we now should have a new
* XMLDocument object with the response from the server. */
String status = response2.get("Response.status");
String authcode = response2.get("Response.CardTxn.authcode");
String dcref = response2.get("Response.datacash_reference");
String time = response2.get("Response.time");
String missingelement = response2.get("Response.missingelement");
/* We'll log them here, just to show you that the values
* are in the strings. Note the last item we tried to
* get does not actually exist, to show that you will get
* an empty string if the element is not in the document. */
logger.log("\n" +
"Status: " + status + "\n" +
"AuthCode: " + authcode + "\n" +
"DataCash Reference: " + dcref + "\n" +
"Time: " + time + "\n" +
"Missing Element: " + missingelement + "\n\n");
catch (FailureReport failureReport) { failureReport.printStackTrace(); }
catch (IOException ioe) { ioe.printStackTrace(); }
catch (org.jdom.JDOMException j) { j.printStackTrace(); }
</HTML> let me know if you want any other information besides this. and thanks again for the help..
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
It looks like what you are doing is being encapsulated in agent.request method call.

Any how check out the link below and see if it helps you out
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
And this
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
And this
[ August 22, 2003: Message edited by: Rahul Mahindrakar ]
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
I suggest checking out Jakarta Commons HttpClient. It has excellent support for things like https and web proxies.
masroor rizvi

Joined: Aug 20, 2003
Posts: 3
thanks for the help mahendra....
i'll look into all these sites and see if things can works out for me...
thanks once again and regards,
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
The solution provided by Chris is good. Try reusing Apache classes if you can.
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
Here's an example
I agree. Here's the link:
subject: SSL in Weblogic
It's not a secret anymore!