vscode-restclient
vscode-restclient copied to clipboard
socket hang up (requests with cert auth) after upgrade vscode to v1.36.1
socket hang up (requests with cert auth) after upgrade vscode to v1.36.1
- REST Client Version: 0.21.3
- VSCode Version: Version: 1.36.1 (user setup) Commit: 2213894ea0415ee8c85c5eea0d0ff81ecc191529 Date: 2019-07-08T22:59:35.033Z Electron: 4.2.5 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Windows_NT x64 10.0.17763
No proxy
Steps to Reproduce:
-
IIS - Create virtual directory test under default website and configure settings 1.a - SSL Settings:
Require SSL Require Client Certificate -
Create index.html file and place it into test virtual directory
<html><body>OK</body></html>
- Create test.http file
GET https://localhost/Test/index.htm
- Edit settings.json (Setup client cert)
"rest-client.certificates": {
"localhost:443": {
"pfx": "_res/Cert.pfx",
"passphrase": "supersecretpassword"
}
},
- Send request GET https://localhost/Test/index.htm
You should get error:
Error: socket hang up
at createHangUpError (_http_client.js:322:15)
at TLSSocket.socketOnEnd (_http_client.js:425:23)
at TLSSocket.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1092:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
In vscode version 1.35.0 worded without errors
- REST Client Version: 0.21.3
- VSCode Version: Version: 1.35.0 (user setup) Commit: 553cfb2c2205db5f15f3ee8395bbd5cf066d357d Date: 2019-06-04T01:17:12.481Z Electron: 3.1.8 Chrome: 66.0.3359.181 Node.js: 10.2.0 V8: 6.6.346.32 OS: Windows_NT x64 10.0.17763
@venkycz thanks for reporting this, did you test the extension on both versions of vscode side by side, did you add some extra setting in newer version, like rest-client.excludeHostsForProxy
@venkycz have tried that remove the port information in the settings, like following:
"rest-client.certificates": {
"localhost": {
"pfx": "_res/Cert.pfx",
"passphrase": "supersecretpassword"
}
},
I couldn't test this side by side, because I have ordinarily updated vsode and after update this problem has occured. But I experienced it on two computers. On the second one before upgrade it still worked but immediately after update it stopped working and since the update "socked hung up" error occures.
I tried remove port information in "rest-client.certificates": { }
with no effect.
I tried exclude hosts from proxy rest-client.excludeHostsForProxy
with no effect too.
I dont use proxy. I have disabled automatic detection of Proxy in system. I tried to disable all computer protection (firewall, antivirus,..) - without changes..
Did you add the certificates in the setting? since in your reply, the value is an empty dictionary, and the value should be like following if the target host of your request url is localhost
"rest-client.certificates": {
"localhost": {
"pfx": "_res/Cert.pfx",
"passphrase": "supersecretpassword"
}
},
ofcourse I did. (it was only for shorten the text...)
@venkycz I can reproduce the issue, and it really behaves as you said, and the same code base works in 1.35.1, while failed in 1.36.0. I guess that it may be related to the upgrade of Electron version in vscode, which internally upgraded Node.js from v10.2.0
to v10.16.0
, I guess the root cause is here. And I will continue to investigate this and also check if there exist some workaround.
@venkycz some updates, this issue is related to the Electron 4 update in vscode 1.36.0, and similar issues have been raised in the official electron project repository, see electron/electron#18380 and electron/electron#18557. I will keep eyes on it. Thanks for reporting this
@Huachao This issue still exists.
@Huachao Is there any work-around for this issue when using client certs for rest calls?
@Huachao Is there a plan as to when the bug will be fixed?
I have the similar problem too.
The workaround is to use older VSCode version 1.35.1
I came accross this issue because I also had a generic socket hangup
message for a simple request on my dev machine.
Eventually the problem was that I tried to access an https endpoint with http (instead of https://localhost:5001
I used http://localhost:5001
).
After 20 minutes searching the web I noticed my mistake. Maybe this comment will help sombody else with the same problem.
I am facing similar issue after upgrading code server version from 3.6.2 to 3.8.0
Error: socket hang up at connResetException (internal/errors.js:604:14) at Socket.socketOnEnd (_http_client.js:460:23) at Socket.emit (events.js:323:22) at endReadableNT (_stream_readable.js:1204:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) { code: 'ECONNRESET'
Found below error in browser console:
ERR Error: WebSocket close with status code 1006
this issue remains.
### get messages
POST {{host}}/api/recruitment/sys_msgs
Authorization: {{token}}
User-Agent: {{useragent}}
Accept: application/json
### get messages
POST {{host}}/api/recruitment/sys_msgs
Authorization: {{token}}
User-Agent: {{useragent}}
Accept: application/json
I am having the problem when I attempt to deploy a web app in vscode. It was hit and miss before. Now I am always getting the problem. Any progress on a fix for the issue?
@anderson9149 did it work for you previously?
It worked sometimes. I read some threads online about logging out of Azure in vscode from command pallete, and then restarting vscode, and trying again. When I did that it was working. However, now it is completely not working and I am getting a “hung socket” error message all the time when I try to deploy.
On Tue, Apr 5, 2022 at 9:49 PM Huachao Mao @.***> wrote:
@anderson9149 https://github.com/anderson9149 did it work for you previously?
— Reply to this email directly, view it on GitHub https://github.com/Huachao/vscode-restclient/issues/389#issuecomment-1089705681, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4LHHKFFNWDAQ5KLPDG34DVDT3SHANCNFSM4ICQNGDQ . You are receiving this because you were mentioned.Message ID: @.***>
It worked sometimes. I read some threads online about logging out of Azure in vscode from command pallete, and then restarting vscode, and trying again. When I did that it was working. However, now it is completely not working and I am getting a “hung socket” error message all the time when I try to deploy. … On Tue, Apr 5, 2022 at 9:49 PM Huachao Mao @.> wrote: @anderson9149 https://github.com/anderson9149 did it work for you previously? — Reply to this email directly, view it on GitHub <#389 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4LHHKFFNWDAQ5KLPDG34DVDT3SHANCNFSM4ICQNGDQ . You are receiving this because you were mentioned.Message ID: @.>
@anderson9149 could you please share me with the request that I can test?