question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid Http response

See original GitHub issue

It seems to be an issue using @ClassRule with https. If I run more than one test, then one of them will fail with the following exception:

Caused by: java.io.IOException: Invalid Http response
  at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1606)
  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
  at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
  at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
  at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:253)
... 34 more

If I change the protocol to be http then the problem disappears.

Using @Rule instead of @ClassRule is another work around, but brings additional overhead.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tommysitucommented, Jul 4, 2018

@tqh actually it is a related issue. It would break some HTTP clients if the response contains both Transfer-Encoding and Content-Length headers. Upgrading to Hoverfly-Java 0.11.0 should fix it.

1reaction
tommysitucommented, Jul 4, 2018

@mlundela, the Hoverfly-Java v0.11.0 release is available. It should fix the bug you raised.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP response status codes - MDN Web Docs - Mozilla
HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
Read more >
"Invalid Http response" on URLConnection.getInputStream ...
The most obvious reason is that you have different ssl/tls/cipher/certificate rules between your client and server.
Read more >
How to Fix 400 Bad or Invalid Request HTTP Error? - WebNots
The 400 Bad or Invalid Request HTTP error could happen if your cookies are outdated or corrupted. Some browser extensions may change the...
Read more >
Invalid http response · Issue #5469 · EOSIO/eos - GitHub
Whenever I am trying to set contract or create wallet/account the following error is showing- Error 3200002: invalid http response Error ...
Read more >
Invalid HTTP response type - webMethods
Invalid HTTP response type ... any ideas? ... What is the HTTP response code returned? You should find that in the header returned...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found