AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SSL failure in simple test case

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> ibm.software.java.linux
View previous topic :: View next topic  
Author Message
Byron Foster
Guest





PostPosted: Sat Aug 30, 2003 9:22 pm    Post subject: SSL failure in simple test case Reply with quote




The Attached program tries to read from an SSLSocket, but it fails with
the following exception:

java.io.IOException: SSL failure
at com.ibm.sslite.u.a(Unknown Source)
at com.ibm.sslite.a.read(Unknown Source)
at com.ibm.jsse.a.read(Unknown Source)
at SSLTest.main(SSLTest.java:41)

This same program completes sucessfully with the Sun 1.4.2 JDK. The
test program writes data out, then manages to read most of the data back
before throwing an IOException. If I only write to the socket but never
read from it the program completes without a problem. Has anyone had
any similar problems? know of a fix/workaround?

Environment:
Linux RedHat 9
IBM SDK 1.4.1 for Linux i386

Thanks,
Byron


import javax.net.*;
import javax.net.ssl.*;
import java.io.*;

public class SSLTest
{
public static final void main(String argv[])
{
String msg="<test></test>n";
byte buf[] = new byte[1000];
int rlength = 0;

try
{
SocketFactory factory = SSLSocketFactory.getDefault();
java.net.Socket socket = factory.createSocket("xml.test.surepay.com", 443);
OutputStream os = socket.getOutputStream();
os.write(msg.getBytes());

InputStream is = socket.getInputStream();
StringBuffer sb = new StringBuffer();

System.out.println("output:");
while ((rlength = is.read(buf, 0, 1000)) != -1)
{
String str = new String(buf, 0, rlength);
System.out.print(str);
}

socket.close();
System.out.println("");
}
catch (Exception e)
{
System.out.println("");
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}

Back to top
Byron Foster
Guest





PostPosted: Tue Sep 09, 2003 11:35 pm    Post subject: Re: SSL failure in simple test case Reply with quote



Byron Foster wrote:
Quote:

The Attached program tries to read from an SSLSocket, but it fails with
the following exception:

java.io.IOException: SSL failure
at com.ibm.sslite.u.a(Unknown Source)
at com.ibm.sslite.a.read(Unknown Source)
at com.ibm.jsse.a.read(Unknown Source)
at SSLTest.main(SSLTest.java:41)

This same program completes sucessfully with the Sun 1.4.2 JDK. The
test program writes data out, then manages to read most of the data back
before throwing an IOException. If I only write to the socket but never
read from it the program completes without a problem. Has anyone had
any similar problems? know of a fix/workaround?

Environment:
Linux RedHat 9
IBM SDK 1.4.1 for Linux i386

I was wondering if anyone is able to reproduce this error given the
attached program on the prior posting. We need to create a secure
socket for doing credit card transactions. I'd like to use the IBM JVM,
but this is a real problem.

Thanks,
Byron


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> ibm.software.java.linux All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.