Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrading to node > 12.12 i get [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:" #253

Open
davidcarma opened this issue Jan 14, 2022 · 0 comments

Comments

@davidcarma
Copy link

Hi,
I tried upgrading my code using http-mitm-proxy from node 10 to node 16 ( and 17).
I started getting the error :

TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
    at new NodeError (node:internal/errors:371:5)
    at new ClientRequest (node:_http_client:158:11)
    at Object.request (node:https:353:10)
    at makeProxyToServerRequest (/Users/davidsaliba/Documents/node-code/Carma_HTTPS_Proxy_LB_Prod/node_modules/http-mitm-proxy/lib/proxy.js:788:38)
    at /Users/davidsaliba/Documents/node-code/Carma_HTTPS_Proxy_LB_Prod/node_modules/http-mitm-proxy/lib/proxy.js:781:16
    at wrapper (/Users/davidsaliba/Documents/node-code/Carma_HTTPS_Proxy_LB_Prod/node_modules/async/dist/async.js:271:20)
    at eachOfArrayLike (/Users/davidsaliba/Documents/node-code/Carma_HTTPS_Proxy_LB_Prod/node_modules/async/dist/async.js:490:13)
    at eachOf (/Users/davidsaliba/Documents/node-code/Carma_HTTPS_Proxy_LB_Prod/node_modules/async/dist/async.js:626:16)
    at awaitable (/Users/davidsaliba/Documents/node-code/Carma_HTTPS_Proxy_LB_Prod/node_modules/async/dist/async.js:211:32)
    at Object.eachLimit (/Users/davidsaliba/Documents/node-code/Carma_HTTPS_Proxy_LB_Prod/node_modules/async/dist/async.js:2686:16) {
  code: 'ERR_INVALID_PROTOCOL'
}

After reverting the version back to 12.12 it seems to work.. but have same issue with ode@11. works on versions 10 and lower.

How can this be fixed ?
Thanks David.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant