Thursday, 15 April 2010

java - SSLPeerUnverifiedException:"peer not authenticated" while using groovy's RestClient with ignoreSSLIssues() -


I am writing an integration test for my rest and point and I have selected the rest of the call of Jiroovi. HTTPS "and I started facing SSL exception. While excavating more in this, I was happy to know about ignoring () method () method () Since it is available in version 0.7.1 of HttpBuilder, I have upgraded this jar and some dependent jars. So with this, according to the doctor, I was expecting the code below to work -

  def httpBuilder = new httpBuilder ('baseurl') httpBuilder.ignoreSSLIssues () def resp = HttpBuilder (Path: 'RestPath') Print Lin  

But it is still throwing javax.net.ssl.SSLPeerUnverifiedException: Peer is not certified.

Any help appreciated on this.

Thank you.

Just ran into this problem. If you use an outbound proxy and do not configure the HTTPBuilder class to use it explicitly, you also get this misleading error.

You need to set the setProxy () method of the HTTPBuilder JVM OPTS such as that- Dhttp.proxyHost does not seem reputable for whatever reason by HTTPBuilder. My version looks like this:

Import groovyx.net.http.HTTPBuilder import static groovyx.net.http.Method.HEAD def http = new HTTPBuilder ('https: // www. Dev .java.net / ') http.setProxy ("my.proxy.com", 8080, "http") http.ignoreSSLIssues () def position = http.request (HEAD) {response.success = {it.status} }

No comments:

Post a Comment