I'm getting the following error while trying to make an https call through
httpclient.
javax.net.ssl.SSLHandshakeException: unknown certificate
at com.ibm.jsse.bg.a(Unknown Source)
at com.ibm.jsse.b.a(Unknown Source)
at com.ibm.jsse.b.write(Unknown Source)
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:139)
at
org.apache.commons.httpclient.methods.StringRequestEntity.writeRequest(StringRequestEntity.java:150)
at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:495)
at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973)
at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
I tried to use the EasySSLProtocolSocketFactory to skip the trust the
certificate, but it is not working.
Protocol myhttps = new Protocol("https",new
EasySSLProtocolSocketFactory(), 443);
httpClient.getHostConfiguration().setHost("xxx.xxx.com", 443, myhttps);
int responseCode = httpClient.executeMethod(postMethod);
Can anyone help me to come out of this issue. I just don't have any
certificates in my environment.
Also, looks new Protocol("https",new EasySSLProtocolSocketFactory(), 443); is a
deprecated method, is there any alternative way for posting the https request
and considering the unknown certificate as a trusted certificate.
Thanks,
Arun Kumar Dubagunta
Phone #: 516-237-4600
E-mail : [EMAIL PROTECTED]
[EMAIL PROTECTED]
-----------------------------------------
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or
entity to which it is addressed. If the reader of this e-mail is
not the intended recipient or his or her authorized agent, the
reader is hereby notified that any dissemination, distribution or
copying of this e-mail is prohibited. If you have received this
e-mail in error, please notify the sender by replying to this
message and delete this e-mail immediately.