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

got (Protocol "https:" not supported. Expected "http:") when set https proxy #255

Open
jianwu opened this issue Sep 20, 2018 · 14 comments
Open

Comments

@jianwu
Copy link

jianwu commented Sep 20, 2018

  • VSCode Version:
    Version 1.25.1 (1.25.1)

  • OS Version:
    MACOS 10.13.6

  • REST Client Version:
    v0.19.1
    Steps to Reproduce:

  1. In .settings file config "http.proxy": "https://....."
  2. When send a request, I got following error:

Protocol "https:" not supported. Expected "http:"

@jianwu jianwu changed the title got (Protocol "https:" not supported. Expected "http:") when setting https proxy got (Protocol "https:" not supported. Expected "http:") when set https proxy Sep 20, 2018
Huachao added a commit that referenced this issue Sep 21, 2018
@Huachao
Copy link
Owner

Huachao commented Sep 21, 2018

@jianwu I have fixed the issue and I will publish this fix in next release.

@Huachao Huachao closed this as completed Sep 21, 2018
@jianwu
Copy link
Author

jianwu commented Sep 21, 2018

Thanks for the quick fix. This extension is excellent!

@Huachao Huachao added the bug label Sep 21, 2018
@Huachao
Copy link
Owner

Huachao commented Oct 8, 2018

@jianwu you can verify this feature in latest version 0.20.0

@jianwu
Copy link
Author

jianwu commented Oct 8, 2018

I tried it. It seems a bit better. But as my proxy is https and the target server is http: so it throws another error:
Hostname/IP doesn't match certificate's altnames: "Host: XXXXXX. is not in the cert's altnames: DNS:XXXXXXX"

I did some research seems you need to add:

proxy.web(req, res, {
changeOrigin: true,
target: https://example.com:3000,
});

if you are using http-proxy or you can provide a setting: {rejectUnauthorized:false}

https://stackoverflow.com/questions/14262986/node-js-hostname-ip-doesnt-match-certificates-altnames

Huachao added a commit that referenced this issue Oct 8, 2018
@Huachao
Copy link
Owner

Huachao commented Oct 9, 2018

@jianwu can you try the latest version 0.20.1 to verify?

@jianwu
Copy link
Author

jianwu commented Oct 13, 2018

I tried the latest 0.20.2, it still doesn't work. I used wireshark to inspect the network traffic. Seems even I put "https://" for the http.proxy setting, it still tries to connect with http protocol. With TLS handshake.So the connect got rejected, I got "read ECONNRESET" error

@Huachao Huachao reopened this Oct 13, 2018
@Huachao
Copy link
Owner

Huachao commented Oct 15, 2018

@jianwu in your case, you are sending request to an HTTPS site, and your proxy is also in HTTPS protocol right, what's the port number of your proxy?

@jianwu
Copy link
Author

jianwu commented Oct 15, 2018 via email

@4nu81
Copy link

4nu81 commented Nov 20, 2019

I also get "ECONNRESET" at TLS handshake on https requests without proxy setup.

@Huachao
Copy link
Owner

Huachao commented Nov 20, 2019

@4nu81 can you provide your request if convenient?

@4nu81
Copy link

4nu81 commented Nov 20, 2019

GET https://{{myhost}}/ HTTP/1.1

leads to:

write EPROTO 797870719880:error:100000f0:SSL routines:OPENSSL_internal:UNSUPPORTED_PROTOCOL:../../third_party/boringssl/src/ssl/handshake_client.cc:568:

The server we reach out for serves https with TLS handshake.

@Huachao
Copy link
Owner

Huachao commented Nov 21, 2019

@4nu81 It may be a bug related to the switch from OpenSSL to BoringSSL in electron which is the foundation of vscode.

@rlundy
Copy link

rlundy commented Dec 12, 2019

I'm getting the same thing when trying an https request:

write EPROTO 1610660856:error:100000f0:SSL routines:OPENSSL_internal:UNSUPPORTED_PROTOCOL:../../third_party/boringssl/src/ssl/handshake_client.cc:568:

@AnWeber
Copy link

AnWeber commented Jun 11, 2021

I was able to trace the error in my case to the use of http2 in got.
With http2 enabled, a http2wrapper is used instead of default https package. The proxy injected by VSCode uses a rather unconventional method to recognize https and therefore does not correctly recognize the http2 wrapper.

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

No branches or pull requests

5 participants