Vscode-restclient: got (Protocol "https:" not supported. Expected "http:") when set https proxy

Created on 20 Sep 2018  Â·  13Comments  Â·  Source: Huachao/vscode-restclient

  • VSCode Version:
    Version 1.25.1 (1.25.1)

  • OS Version:
    MACOS 10.13.6

  • REST Client Version:
    v0.19.1
    Steps to Reproduce:
  • In .settings file config "http.proxy": "https://....."
  • When send a request, I got following error:

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

bug upstream

Most helpful comment

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:

All 13 comments

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

Thanks for the quick fix. This extension is excellent!

@jianwu you can verify this feature in latest version 0.20.0

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

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

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

@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?

My case, the proxy is in HTTPS and port number 8443, the target server is
http, port number is 8080.

On Sun, Oct 14, 2018, 7:31 PM Huachao Mao notifications@github.com wrote:

@jianwu https://github.com/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?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Huachao/vscode-restclient/issues/255#issuecomment-429690188,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAB8ETACe2Hdu15co17dFWj-UbekP-0_ks5uk_N5gaJpZM4Wy1js
.

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

@4nu81 can you provide your request if convenient?

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.

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

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:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lldata picture lldata  Â·  13Comments

OzgurDogan picture OzgurDogan  Â·  13Comments

akalcik picture akalcik  Â·  16Comments

symbioticKid picture symbioticKid  Â·  28Comments

johnbeynon picture johnbeynon  Â·  23Comments