hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Java Man <fb_h...@yahoo.com>
Subject httpclient with SSL
Date Mon, 12 Sep 2005 18:37:40 GMT
Hi,
 
I am unable to get SSL connection to a third party server. I have done everything possible
to install JSSE with J2SE 1.3, but I get -

javax.net.ssl.SSLHandshakeException: FATAL Alert:HANDSHAKE_FAILURE - The handshake handler
was unable to negotiate an acceptable set of security parameters.

To test my SSL installation I used this code I got from Jakarta httpclient website - 

====================================================================

import java.io.BufferedReader;

import java.io.InputStreamReader;

import java.io.OutputStreamWriter;

import java.io.Writer;

import java.net.Socket;

import javax.net.ssl.SSLSocketFactory;

public class SSLTest {

public static final String TARGET_HTTPS_SERVER = "www.verisign.com"; 

public static final int TARGET_HTTPS_PORT = 443; 



public static void main(String[] args) throws Exception {



System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");

Socket socket = SSLSocketFactory.getDefault().

createSocket(TARGET_HTTPS_SERVER, TARGET_HTTPS_PORT);

try {

Writer out = new OutputStreamWriter(

socket.getOutputStream(), "ISO-8859-1");

out.write("GET / HTTP/1.1\r\n"); 

out.write("Host: " + TARGET_HTTPS_SERVER + ":" + 

TARGET_HTTPS_PORT + "\r\n"); 

out.write("Agent: SSL-TEST\r\n"); 

out.write("\r\n"); 

out.flush(); 

BufferedReader in = new BufferedReader(

new InputStreamReader(socket.getInputStream(), "ISO-8859-1"));

String line = null;

while ((line = in.readLine()) != null) {

System.out.println(line);

}

} finally {

socket.close(); 

}

}

}

====================================================================

 

Can anyone shed some light on this?

 

Thanks.


		
---------------------------------
Yahoo! for Good
 Click here to donate to the Hurricane Katrina relief effort. 
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message