node-http-mitm-proxy icon indicating copy to clipboard operation
node-http-mitm-proxy copied to clipboard

HTTPS Forward does not work everytime (some queries are canceled)

Open DblK opened this issue 5 years ago • 2 comments

Hi,

I am using your library to build a proxy and I found out that some query does not pass inside my onRequest function. After a little digging, it seems that an error happened inside the proxy and does not fire all onRequest function.

Here is an html file that help to reproduce the issue:

<html>
    <head>
        <title>Test MITM Proxy</title>
    </head>
    <body>
        Test page

        <script src='https://cdnjs.cloudflare.com/ajax/libs/flexboxgrid/6.3.1/flexboxgrid.min.css'></script>
    </body>
</html>

If you use a browser with the proxy attached, you will see in the network tab that the query has been canceled. It seems that the client (browser) is canceled the query due to security issue. Maybe a trouble with a certificate but could not find yet the problem.

I would appreciate a workaround or a fix to this (or maybe I am using in a bad way the module).

Edit: I am on MacOS and I added the CA to the Keychain and also trust for everything. I am testing it with firefox and proxy param (inside firefox) to point to the proxy localhost:8080 for HTTP and HTTPS.

Thanks in advance DblK

DblK avatar Mar 08 '19 08:03 DblK

After some tests, I added a onConnect based on the example forwardHttps.js and I have no issue to retrieve the content. But I really need to be able to know which resource and so use onRequest and onResponse function.

Any idea?

DblK avatar Mar 08 '19 09:03 DblK

i'm having similar issue, did you ever figure this out?

iggyZiggy avatar Mar 28 '20 17:03 iggyZiggy