Skip to content

Axios Proxy Issues - 501 and SSL errors #3459

@dinojs

Description

@dinojs

Describe the bug

Getting weird error messages when passing a proxy into an Axios request. I've tried to add a proxy parameter to the following GET request and I get a 501 error code and when I then add a protocol parameter to the proxy object I get an openssl error

Note that I don't have any of these issues when using the library axios-https-proxy-fix, https://www.npmjs.com/package/axios-https-proxy-fix

To Reproduce

axios
    .get(prod, {
        proxy: {
            host: proxy.host,
            port: proxy.port,
            auth: {
                username: proxy.userName,
                password: proxy.password,
            },
        }
    })

Then I tried adding protocol to the proxy object, like so:

axios
    .get(prod, {
        proxy: {
            protocol: "https",
            host: proxy.host,
            port: proxy.port,
            auth: {
                username: proxy.userName,
                password: proxy.password,
            },
        }
    })

Error:

write EPROTO 17828:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:

Expected behavior

No 501 and no openssl issues. Should get a 200 response.

Environment

  • Axios Version 0.21.0
  • Node.js Version 12.17
  • OS: Windows 10

Additional context/Screenshots

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions