Hi, there

While trying to use HttpClient for a SSL application, I encountered an exception, the 
codes I used were as follows(the URL is made up here):

HttpClient client = new HttpClient();
 HostConfiguration config = client.getHostConfiguration();
 HttpsURL sslURL = new HttpsURL("https://sample.com/test.asp";);
 config.setHost(sslURL);
 PostMethod post = new PostMethod();

 String sXML = "<to>https://sample.com/test.asp</to>";
 post.setRequestBody(sXML);
 post.setRequestContentLength(sXML.getBytes(sEncoding).length);
 post.setRequestHeader("Content-type", "text/xml; charset=Big");
 client.executeMethod(client.getHostConfiguration(), post);


and the exception occured was:

 javax.net.ssl.SSLHandshakeException: unknown certificate

my development environment is:

 OS : Windows 2000
 AP Server : IBM WebSphere 5
 JDK : WebSphere JDK

appreciate for any suggestions and solutions for the problem.

best regards

crescent

Reply via email to