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

Happened Again - Requests to servers using letsencrypt's new root certificate fail verifiction #136787

Closed
AlencarGabriel opened this issue Nov 9, 2021 · 22 comments · Fixed by #137241 or #143223
Assignees
Labels
confirmed Issue has been confirmed by VS Code Team member electron Issues and items related to Electron fixed-in-electron-16 Issues fixed with Electron 16.x update insiders-released Patch has been released in VS Code Insiders upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues
Milestone

Comments

@AlencarGabriel
Copy link

AlencarGabriel commented Nov 9, 2021

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.62.1
  • OS Version: Windows_NT x64 10.0.18362

More details:

Version: 1.62.1 (user setup)
Commit: f4af3cb
Date: 2021-11-05T10:57:55.946Z
Electron: 13.5.2
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.18362

Steps to Reproduce:

The same steps as the problems: #134244 and #134245.

@deepak1556
Copy link
Contributor

I am unable to repro with 1.62.1, added the sample from #134244 to a minimal extension and didn't see the error triggered.

Can you provide some minimal repro steps, thanks!

@deepak1556 deepak1556 added info-needed Issue requires more information from poster windows VS Code on Windows issues and removed confirmation-pending labels Nov 9, 2021
@AlencarGabriel
Copy link
Author

I made a minimal example using the GOT library that I use in my extension, and reproduced it as follows:

got.get('https://letsencrypt.org').then((response: Response) => {
		console.log(response.body);
	}).catch((error: any) => {
		console.error(error);
	});

I downgraded the VSCode version to 1.61.2 and it works. When upgrading to 1.62.1 it returns to having certificate errors:

GotError: certificate has expired
    at onError (c:\Users\gabriel.alencar\Documents\Gitea\vscode-engpro-extension\node_modules\got\dist\source\request-as-event-emitter.js:140:29)
    at handleRequest (c:\Users\gabriel.alencar\Documents\Gitea\vscode-engpro-extension\node_modules\got\dist\source\request-as-event-emitter.js:173:17)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)
    at TLSSocket.emit (events.js:315:20)
    at TLSSocket._finishInit (_tls_wrap.js:932:8)
    at TLSWrap.onhandshakedone (_tls_wrap.js:706:12)
    at TLSWrap.callbackTrampoline (internal/async_hooks.js:131:14)

@deepak1556
Copy link
Contributor

I am unable to repro on macOS will check on windows,

1.62.1 was updated to Electron 13.5.2 and previous versions were using Electron 13.5.1. There is a difference in the fix between these two versions.

13.5.1 adds X509_V_FLAG_TRUSTED_FIRST to the openSSL verification api used by Node.js network code which will construct the certificate chain during verification with trusted certificates from the bundle. electron/electron#31215

13.5.2 undo the above change and instead removes the expired DST Root CA X3 from the bundled trust store, because the alternative trust ISRG Root X1 is already present in the bundle. electron/electron#31220

Not sure why it is failing in your case.

@deepak1556 deepak1556 added confirmation-pending electron Issues and items related to Electron upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Nov 9, 2021
@scottmollon-invicara
Copy link

I am also seeing the same issue on Windows. It popped up as soon as vscode upgraded to 1.62.1. My extension can't make any api calls because of it. My coworker on a Mac also cannot reproduce the issue.

@alvarolb
Copy link

alvarolb commented Nov 11, 2021

Same here on Windows 10. Linux version working fine.

image

@a-bronx
Copy link

a-bronx commented Nov 11, 2021

Same issue, server-rendered preview in the PlantUML extension (jebbs.plantuml) is broken due to this error.

Version: 1.62.1 (user setup)
OS: Windows_NT x64 10.0.19042

@thierrymarianne
Copy link

thierrymarianne commented Nov 15, 2021

Same issue, server-executed symbolic execution of rust-based smart contracts with SafePKT extension (v0.2.10),
broken due to this error.

Version: 1.62.1
OS: Ubuntu 20.10

Thank you @AlencarGabriel for having reported this issue in the first place!

@larshp
Copy link
Contributor

larshp commented Nov 15, 2021

same issue, 1.62.2, certificate on https://schema.abaplint.org/schema.json is valid, OS: windows 10

image

@ivchicano
Copy link

As a workaround, it seems to work if the user sets this option in user settings in VSCode

"http.systemCertificates": false,

On Windows 10 our extension can't make api calls unless the user changes this setting

ivchicano added a commit to codeurjc-students/2019-VSCode4Teaching that referenced this issue Nov 15, 2021
@deepak1556 deepak1556 added confirmed Issue has been confirmed by VS Code Team member fixed-in-electron-16 Issues fixed with Electron 16.x update and removed confirmation-pending info-needed Issue requires more information from poster labels Nov 15, 2021
@jnv
Copy link

jnv commented Nov 15, 2021

I am running into the same issue on Linux (Fedora 35, VSCode v1.62.2 from official RPM build), disabling http.systemCertificates works for me as well.

@deepak1556
Copy link
Contributor

Sorry for the delay in getting back to this issue, firstly I was able to confirm the issue on windows. Based on #136787 (comment) it seems application adds root CA from the OS to the node network stack used in the extension host by #52880.

As explained in #136787 (comment) due to the fix implemented in Electron versions <= 15, building certificate chains from the OS that carries the expired DST Root CA X3 certificate will fail.

I would suggest to use the setting http.systemCertificates: false till we update to Electron 16 which we are actively looking into.

@larshp
Copy link
Contributor

larshp commented Nov 16, 2021

@deepak1556 thanks, looking at #136630 it seems like Electron 16 update is not part of this iteration? I'm not sure how much effort it is, but are we looking at half a year, or few months ahead?

@ZeWaka
Copy link

ZeWaka commented Nov 23, 2021

I think the label electron-16-update is valid here?

@viceice
Copy link

viceice commented Dec 8, 2021

same here 😕
image

setting http.systemCertificates: false works

@bramses
Copy link

bramses commented Dec 18, 2021

My users are getting this issue as well on Linux and Windows machines, Macs seem to work fine

@SchroederSteffen
Copy link

SchroederSteffen commented Jan 28, 2022

I removed the expired DST Root CA X3 from the windows trust store and it solved the issue for me.
(I didn't set http.systemCertificates: false.)

@viceice
Copy link

viceice commented Jan 28, 2022

I removed the expired DST Root CA X3 from the windows trust store and it solved the issue for me.
(I didn't set http.systemCertificates: false).

Windows will automatically refetch the cert, so removal isn't a option.

@SchroederSteffen
Copy link

I removed the expired DST Root CA X3 from the windows trust store and it solved the issue for me.
(I didn't set http.systemCertificates: false).

Windows will automatically refetch the cert, so removal isn't a option.

Okay thanks for the clarification. 👍

@larshp
Copy link
Contributor

larshp commented Feb 4, 2022

Did not make it into the January release, hoping for February 🤩

@larshp
Copy link
Contributor

larshp commented Mar 31, 2022

confirmed working in 1.66, thanks ❤️

@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
confirmed Issue has been confirmed by VS Code Team member electron Issues and items related to Electron fixed-in-electron-16 Issues fixed with Electron 16.x update insiders-released Patch has been released in VS Code Insiders upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

15 participants