jgritman / httpbuilder

315 stars 154 forks source link

ignoreSSLIssues() not providing described functionality #49

Closed zanzamar closed 9 years ago

zanzamar commented 9 years ago

Using the following code:

def http = new HTTPBuilder( params.uri )

// [ NOTE ] - We would need to do some configuration to setup ssl truststore.
// ignoreSSLIssues is convenient but less secure: https://github.com/jgritman/httpbuilder/wiki/SSL
http.ignoreSSLIssues()
http.request( POST ) {
    params.headers.each { k, v ->
        headers."${ k }" = "${ v }"
    }
    uri.path = params.path
    uri.query = params.query
    send( params.contentType ? params.contentType : JSON, params.body )

    response.success = params.success
    response.failure = params.failure
}

I am still getting javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated.

Using groovy 2.3.1 and in a grails 2.3.7 environment ( java 1.7 )

I have tried both 0.7.1 and 0.7.2 of httpbuilder: org.codehaus.groovy.modules.http-builder:http-builder:0.7.1

When checking the classLoader class path it points to the proper 0.7.1 or 0.7.2 library.

Any thoughts?

zanzamar commented 9 years ago

I went the route of making a build directly from the github repo.

I dropped that build: http-builder-0.7.3-SNAPSHOT.jar, along with ezmorph-1.0.6.jar and json-lib-2.4-jdk15.jar into the /lib directory.

Additionally, compile 'org.apache.httpcomponents:httpclient:4.5' was added to the BuildConfig.groovy

Everything seems to work now.