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.

HTTPS over HTTP Proxy Fails

See original GitHub issue

Describe the bug

HTTPS over HTTP Proxy Fails with 500 handshakefailed on mcafee proxy. mcafee initialize server context:handshakefailed:server state 1:state 9:Application response 500 handshakefailed With HTTP_PROXY and HTTPS_PROXY set, curl works but axios.get fails.

To Reproduce

import axios from 'axios';

(async () => {
  try {
    console.log(await axios.get('https://github.com/'));
  } catch (e) {
    console.log(e);
  }
})();

Expected behavior

Request should succeed.

Environment

  • Axios Version [0.21.0]
  • Node.js Version [v12.18.3]
  • OS: [OSX 10.15.7]

Additional context/Screenshots

N/A

Current workaround

Install global-agent, remove the HTTP_PROXY env vars and set GLOBAL_AGENT_HTTP_PROXY.

Add import 'global-agent/bootstrap'; to index.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:25
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

32reactions
saamalikcommented, Jan 23, 2021

Hi @Niek - any ideas why the axios-https-proxy-fix fix aren’t merged into axios? I’m sure a lot of people are running into this.

14reactions
linchen1987commented, Sep 2, 2021

set proxy to false can fix:

const axios = require('axios').create({ proxy: false })

Read more comments on GitHub >

github_iconTop Results From Across the Web

Request to HTTPS with HTTP proxy fails #925 - axios ... - GitHub
Summary Trying to do a HTTPS request with a HTTP proxy fails. const req = await axios({ url: 'https://somedomain.com', proxy: { host: ...
Read more >
HTTPS Proxy connections fail with certificate_unknown error
Attempts to connect to an HTTPS SSL site via the Rational Integration Tester (RIT) HTTP Proxy fail. The Proxy log reports "Received fatal ......
Read more >
HTTPS connections over proxy servers - Stack Overflow
Proxy starts HTTPS session to target; Proxy verifies integrity of SSL certificate; displays error if the cert is not valid. Proxy streams ...
Read more >
Using HTTP Proxy Server Over SSL Fails with Error "Failed to ...
Symptoms. Seeing the following error when using the HTTP Proxy with HTTPS protocol: error "Failed to communicate with proxy: null/-1"
Read more >
configurable-http-proxy - npm
Start using configurable-http-proxy in your project by running `npm i ... git clone https://github.com/jupyterhub/configurable-http-proxy cd ...
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