SSL question
Hi,ALL
I am new to Security.
One of my customer's public folder is ssl enabled.
So when I use Java httpclient to build a connection with the public folder.
https://server/public
It throws and exception:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
The question is:
Have I to get a client certificate from Server?
I want to do like IE, when I browser public folder with ssl enabled.
It will pop up a dialog to ask you to trust or not.
How to implement this ?
Thanks.
here is my code
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
System.setProperty("javax.net.ssl.trustStore","E:\\Program Files\\jdev1012\\jdk\\jre\\lib\\security\\cacerts");
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
NTCredentials creds =new NTCredentials("administrator","password","172.16.0.20","");
setState(new WebdavState());
HttpState clientState = getState();
clientState.setCredentials(null,"172.16.0.20",creds);
//getHostConfiguration().setHost("172.16.0.20", 443, protocol);
method =new SearchMethod("https://172.16.0.20/public/Manager");
method.setDebug(3);
method.setRequestHeader("Translate","f");
method.setRequestHeader("Content-Type","text/xml");
method.setRequestHeader("Depth","1");
method.setRequestHeader("Content-Length","" + query.length());
method.setRequestBody(query);
method.setFollowRedirects(true);
int result = executeMethod(method);
Document m_doc = method.getResponseDocument();
method.releaseConnection();
}catch(Throwable ex)
{
ex.printStackTrace();
}

