https / SSL does not working with 3.0.1 due to SSLHandshakeException

460 views
Skip to first unread message

Kotibabu Yaganti

unread,
Dec 16, 2016, 3:10:57 PM12/16/16
to REST assured
Hello,

I am unsuccessful in testing an HTTPS url with the below code

    RestAssured.config = RestAssuredConfig.newConfig().sslConfig(SSLConfig.sslConfig().allowAllHostnames());
        RestAssured.authentication = RestAssured.certificate("jsonplaceholder.jks", "json1234");
    try {
            RestAssured.given().trustStore("jsonplaceholder.jks", "json1234").when().get("https://jsonplaceholder.typicode.com/posts/1").then().body(containsString("expedita"));
        } finally {
            RestAssured.reset();
        }
        
 tried all the possible ways mentioned in the below test with no luck (both jdk 7 and 8).
 rest-assured/examples/rest-assured-itest-java/src/test/java/io/restassured/itest/java/SSLITest.java
 
 I am getting this error.
 javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
 

can you please check it and let me know if I miss anything or a solution that works.

thx,
koti.

Johan Haleby

unread,
Dec 18, 2016, 2:20:29 AM12/18/16
to rest-a...@googlegroups.com
When I do:

given().relaxedHTTPSValidation().when().get("https://jsonplaceholder.typicode.com/posts/1").then().body(containsString("expedita"));
I get:

javax.net.ssl.SSLException: Received fatal alert: internal_error

at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:553)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:412)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:328)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:612)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.apache.http.client.HttpClient$execute$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at io.restassured.internal.RequestSpecificationImpl$RestAssuredHttpBuilder.doRequest(RequestSpecificationImpl.groovy:2115)
at io.restassured.internal.http.HTTPBuilder.doRequest(HTTPBuilder.java:494)
at io.restassured.internal.http.HTTPBuilder.request(HTTPBuilder.java:451)

Never seen this before. I've tried supplying different protocols to the relaxedHTTPSValidation method but I always get the same error.. Very strange, if you get any insights into this please let us know.

/Johan

--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kotibabu Yaganti

unread,
Dec 19, 2016, 2:19:31 AM12/19/16
to REST assured
thanks for checking this.

is there any other way (code) of testing this https url with rest assured api ?

even with the older version of restassured api.

thx,
koti.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.

Johan Haleby

unread,
Dec 19, 2016, 3:05:08 AM12/19/16
to rest-a...@googlegroups.com
Well https should work (and does work) for most cases, never seen this before :/

To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages