Burp Suite User Forum

Create new post

IBurpExtenderCallbacks.makeHttpRequest() throws RuntimeException

August | Last updated: Nov 08, 2017 12:02AM UTC

If the network connection fails, callbacks.makeHttpRequest throws a RuntimeException. Any way we could get that method to declare that it throws a proper subclass of (presumably) IOException so we could check for and handle it in code?

PortSwigger Agent | Last updated: Nov 08, 2017 09:03AM UTC

Hi August, Thanks for your message. I agree, it would be better to throw some kind of IOException in this scenario. I've created a story on our development backlog for this. I'm afraid this won't get particularly high priority, and there are concerns about breaking compatibility. But we'll get to it eventually. Please let us know if you need any further assistance.

Burp User | Last updated: Nov 08, 2017 10:05PM UTC

Seems like sometimes callbacks.makeHttpRequest() throws RuntimeException, other times IHttpRequestResponse.getResponse() just returns null. Here is the code: URL url = new URL(requestUrl); IHttpService service = new HttpService(url); IHttpRequestResponse ihrr = callbacks.makeHttpRequest(service, requestBytes); byte[] responseBytes = ihrr.getResponse(); I'd be interested to know which cases produce which results. In my testing I simulated a bad network connection by turning WiFi completely off. Is there a bug in the API?

PortSwigger Agent | Last updated: Nov 09, 2017 10:22AM UTC

Hi August, I tried out some examples and it depends on the type of error. DNS failure produces an exception, while a closed port produces a null response. While this isn't an ideal interface, you should be able to use it fine if you check for both exceptions and null. At some point we'll be doing a refactor of the API and we'll endeavor to make error handling clearer then.

You must be an existing, logged-in customer to reply to a thread. Please email us for additional support.