Grails:Groovy:SSLPeerUnverifiedException: peer not authenticated

后端 未结 2 2080
北恋
北恋 2021-01-18 04:34

I want to hit an xml request to a url while running the code in my local system it is working well i have created a war file and deployed the same in server,but while runnin

相关标签:
2条回答
  • 2021-01-18 04:44

    Workaround: The following answer provides a workaround for this issue: https://stackoverflow.com/a/25076888/782034

    Just found out that new version (0.7.1) of HttpBuilder introduces method:

    ignoreSSLIssues()
    

    This solves all problems regarding invalid SSL certificates (of course you have to be aware that it also decrease security).

    More information about this method: http://groovy.codehaus.org/modules/http-builder/doc/ssl.html (section at the bottom)

    i.e.

    def http = new HTTPBuilder(url)
    http.ignoreSSLIssues()
    

    Solution: If you want to do things the 'proper' way, checkout the other solutions regarding importing the server's certificates. e.g. SSLPeerUnverifiedException: peer not authenticated

    0 讨论(0)
  • 2021-01-18 04:44

    If you use ignoreSSLIssues() but still get same exception.

    Just add latest httpclient into Gradle/Maven

    compile 'org.apache.httpcomponents:httpclient:4.5.3'

    Can't use ignoreSSLIssues in HttpBuilder version 0.7.1

    0 讨论(0)
提交回复
热议问题