Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use ignoreSSLIssues in version 0.7.1 #75

Open
zcmgyu opened this issue May 10, 2017 · 2 comments
Open

Can't use ignoreSSLIssues in version 0.7.1 #75

zcmgyu opened this issue May 10, 2017 · 2 comments

Comments

@zcmgyu
Copy link

zcmgyu commented May 10, 2017

Java 8:
IDE: IntelliJ IDEA
Gradle 3

I have problem with SSL issue

import groovyx.net.http.RESTClient

def client = new RESTClient()
client.ignoreSSLIssues()
def result = client.get([uri: "https://sacvo76l6b.execute-api.ap-northeast-1.amazonaws.com/"])

It throws below exception

javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:431)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1066)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1044)
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515)
at groovyx.net.http.RESTClient.get(RESTClient.java:119)
at Test.getAuthCode_(Test.groovy:53)

Although I'm using ignoreSSLIssues(), it seems like not work for me.
PS: Uri works fine for me if i use Postman

Could you have any idea? Thanks alot 🥇

@zcmgyu
Copy link
Author

zcmgyu commented May 10, 2017

To resolve "javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated" issue
I just import lastest version of httpclient to Gradle/Maven
compile 'org.apache.httpcomponents:httpclient:4.5.3'

It took me 2 days to resolves. I hope this will be helpful with someone like me.

@rtretyak
Copy link

rtretyak commented Jul 5, 2017

I regret I didn't find this post 3 hours earlier.
@zcmgyu Thanks for saving my sleep time today.
By the way, in my case it was enough just to update the httpClient. After update the ignoreSsl thing was no longer needed. I bet this is due to lack of SNI support in the earlier versions of apache httpClient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants