{"action":"created","issue":{"url":"https://api.github.com/repos/jayway/rest-assured/issues/633","repository_url":"https://api.github.com/repos/jayway/rest-assured","labels_url":"https://api.github.com/repos/jayway/rest-assured/issues/633/labels{/name}","comments_url":"https://api.github.com/repos/jayway/rest-assured/issues/633/comments","events_url":"https://api.github.com/repos/jayway/rest-assured/issues/633/events","html_url":"https://github.com/jayway/rest-assured/issues/633","id":127680136,"number":633,"title":"closeIdleConnectionsAfterEachResponse closes the response before consuming is possible","user":{"login":"mdzhigarov","id":1481379,"avatar_url":"https://avatars.githubusercontent.com/u/1481379?v=3","gravatar_id":"","url":"https://api.github.com/users/mdzhigarov","html_url":"https://github.com/mdzhigarov","followers_url":"https://api.github.com/users/mdzhigarov/followers","following_url":"https://api.github.com/users/mdzhigarov/following{/other_user}","gists_url":"https://api.github.com/users/mdzhigarov/gists{/gist_id}","starred_url":"https://api.github.com/users/mdzhigarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdzhigarov/subscriptions","organizations_url":"https://api.github.com/users/mdzhigarov/orgs","repos_url":"https://api.github.com/users/mdzhigarov/repos","events_url":"https://api.github.com/users/mdzhigarov/events{/privacy}","received_events_url":"https://api.github.com/users/mdzhigarov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2016-01-20T13:18:19Z","updated_at":"2016-02-06T07:06:13Z","closed_at":"2016-01-22T15:13:55Z","body":"Im using the following configuration to reproduce the issue: \r\n\r\nRestAssured.config = RestAssured.config().connectionConfig(new ConnectionConfig().closeIdleConnectionsAfterEachResponse());\r\nRequestSpecification request = given().relaxedHTTPSValidation()\r\n                         .contentType(Constants.XML_CONTENT_TYPE)\r\n                         .auth().basic(\"usr\",\r\n                                       \"pass\");\r\nrequest .contentType(\"application/json\");\r\nrequest.accept(\"application/json\");\r\nrequest.body(...);\r\nrequest.when().post(restURL).then().extract().response().asString();\r\n\r\nThe asString() call throws exception:\r\njava.net.SocketException: Socket is closed\r\n\tat sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1520)\r\n\tat sun.security.ssl.AppInputStream.read(AppInputStream.java:95)\r\n\tat org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:160)\r\n\tat org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:84)\r\n\tat org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:273)\r\n\tat org.apache.http.impl.conn.LoggingSessionInputBuffer.readLine(LoggingSessionInputBuffer.java:116)\r\n\tat org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:240)\r\n\tat org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:206)\r\n\tat org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:169)\r\n\tat java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:238)\r\n\tat java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)\r\n\tat java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)\r\n\tat org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137)\r\n\tat org.apache.http.conn.EofSensorInputStream$read.call(Unknown Source)\r\n\tat com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl.convertStreamToByteArray(RestAssuredResponseOptionsGroovyImpl.groovy:430)\r\n\tat sun.reflect.GeneratedMethodAccessor158.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)\r\n\tat org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:151)\r\n\tat org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:206)\r\n\tat com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl.charsetToString(RestAssuredResponseOptionsGroovyImpl.groovy:482)\r\n\tat com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl$charsetToString$3.callCurrent(Unknown Source)\r\n\tat com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl.asString(RestAssuredResponseOptionsGroovyImpl.groovy:170)\r\n\tat com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl.asString(RestAssuredResponseOptionsGroovyImpl.groovy:166)\r\n\tat com.jayway.restassured.internal.RestAssuredResponseOptionsImpl.asString(RestAssuredResponseOptionsImpl.java:194)\r\n\r\nThis happens only with json. application/xml is deserialized correctly.\r\n\r\nSeems like the socket is closed prematurely.\r\nPlease investigate"},"comment":{"url":"https://api.github.com/repos/jayway/rest-assured/issues/comments/180708850","html_url":"https://github.com/jayway/rest-assured/issues/633#issuecomment-180708850","issue_url":"https://api.github.com/repos/jayway/rest-assured/issues/633","id":180708850,"user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"created_at":"2016-02-06T07:06:13Z","updated_at":"2016-02-06T07:06:13Z","body":"Probably in a few weeks. There are some other issues I'd like to sort out first."}}