axios: AxiosError: write EPROTO 1C3B0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:355:

I get this error when I try to send a request via proxy with Axios. I’ve searched the Internet, but I haven’t been able to reach any results.

const axios = require('axios')

axios({
    url: 'http://medal.tv',
    method:'GET',
    proxy: {
        protocol: 'http',
        host: 'xxx',
        port: 3000,
        auth: { username: 'xxx', password: 'xxx' }
    }
}).then(e => console.log(e.data)).catch(e => console.log(e))

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 14
  • Comments: 18

Most upvoted comments

Solution: You only get this error when you change a supported proxy from “http” to “https”. So if you wrote “https://” change it to “http://”. Or vice versa.

Try like that with HttpsProxyAgent.

axios.get("website", {
        httpsAgent: new HttpsProxyAgent('http://USER:PASSWORD@IP:PORT')
    }).then((res) => {
       // do something
})

I was getting the error because in the proxy I wrote https instead of http.

I hope it will help you

In node, use axios-https-proxy-fix instead of axios if you have to use https proxy. Axios is apparently broken.

const axios = require('axios-https-proxy-fix');

What are you waiting to put it as resolved?

same here, how fix?

nodejs implementation

      const axiosConfig = {
        proxy: {
          host: 'localhost',
          port: 8888, // Replace with your proxy port
          protocol: 'http', // Change to 'http' for HTTP proxy
          // Optionally, you can provide authentication credentials if your proxy requires them
        },
      };
      ```

You could try your call with curl curl -vvv http://medal.tv --proxy http://username:password@xxx:3000. This will probably result in a better error message to google…