-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Skip expired certificates from the OS #184271
Comments
Could you install the Network Proxy Test extension (https://marketplace.visualstudio.com/items?itemName=chrmarti.network-proxy-test) and check the output of If you cannot install the extension through the Extensions viewlet in VS Code, you can use the |
Hi Network Proxy Test: Test Connection VS Code 1.78.2 (b3e4e68) Settings:
Environment variables: Sending GET request to https://example.com...
======================================================================== VS Code 1.78.2 (b3e4e68) Settings:
Environment variables: Sending GET request to https://example.com (allowing unauthorized)...
======================================================================== VS Code 1.78.2 (b3e4e68) Settings:
Environment variables: Sending GET request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token... Sending GET request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token (allowing unauthorized)...
|
The extension fails to log the entire "Certificate chain", is there anything in the Extension Host output channel indicating a problem? ( |
Sorry, It's too long, so I Copy Part. ================================================================= Network Proxy Test: Test Connection Note: Make sure to replace all sensitive information with dummy values before sharing this output. VS Code 1.78.2 (b3e4e68) Settings:
Environment variables: Sending GET request to https://example.com...
Network Proxy Test: Test Connection (allowing unauthorized) Note: Make sure to replace all sensitive information with dummy values before sharing this output. VS Code 1.78.2 (b3e4e68) Settings:
Environment variables: Sending GET request to https://example.com (allowing unauthorized)...
======================================================================== Note: Make sure to replace all sensitive information with dummy values before sharing this output. VS Code 1.78.2 (b3e4e68) Settings:
Environment variables: Sending GET request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token... Sending GET request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token (allowing unauthorized)...
|
The certificate chain looks fine, it is not clear to me where the CERT_HAS_EXPIRED comes from. Could you also append the output from |
Note: Make sure to replace all sensitive information with dummy values before sharing this output. VS Code 1.78.2 (b3e4e68) Certificates loaded from the OS (Keychain Access > Certificates > 'Several Keychains'):
|
There is an expired certificate in your OS root certificates that might explain this (though there are also built-in certificates that should cover this case). Could you try removing this expired certificate from the OS (in the
Would be great to know if this works. (We could investigate if we can skip expired certificates when loading them from the OS.) One alternative might be to update the root certificates in your OS, but I haven't tried this myself. (Newer versions of macOS also come with newer certificates.) |
I delete it, still eror, I can't login. Then turn off VSCode, and try again, I success. Why this issue is relation with "DigiCert" Certification Thanks |
This seems to be a detail in how Node.js verifies the certificate chain. It seems to first complete the chain with a root certificate and then check for expiration dates without going back and trying other (potentially unexpired) certificates. We can skip expired certificates when loading them from the OS to improve this. |
+1 to this issue. Was running into this as I tried to use the new C# Dev Kit and was greatly confused. Have quite a few expired certs when I looked; not even sure I can remove them given our hodgepodge infrastructure. Any update on when this fix will be pushed to insider, if not stable? |
This is in the latest VS Code Insiders now (part of @vscode/proxy-agent 0.15.0). Would be great if you could give it a try and let us know if it fixes the issue for you. Thanks! |
Great! It works! The following is the latest VS Code Insiders: 2023-07-10 14:39:46.659 [info] Logging in for the following scopes: email offline_access openid profile |
the bug is still there, the latest VS Code Insiders: 2023-07-10 15:07:39.294 [error] Fetching token failed for scopes (email offline_access openid profile): request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token failed, reason: certificate has expired |
@HEUDavid Could you install the Network Proxy Test extension (https://marketplace.visualstudio.com/items?itemName=chrmarti.network-proxy-test) and check the output of |
Ignore the certificate issues and retry, returns 200. But what I'm curious about is that the insider version still can't log in with a Microsoft account to sync the configuration. Network Proxy Test extension output: VS Code 1.81.0-insider (ad791ef) Settings:
Environment variables: Sending GET request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token... Sending GET request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token (allowing unauthorized)...
Microsoft Authentication: |
@HEUDavid Could you also append the output from |
Note: Make sure to replace all sensitive information with dummy values before sharing this output. VS Code 1.81.0-insider (ad791ef) Certificates loaded from the OS (Keychain Access > Certificates > 'Several Keychains'):
|
I use a http proxy, and solved my problem, login succ... Note: Make sure to replace all sensitive information with dummy values before sharing this output. VS Code 1.81.0-insider (5150ef0) Settings:
Environment variables: Sending GET request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token...
|
Interesting, I would not have expected that to trigger the CERT_HAS_EXPIRED error. 🤔 |
Not sue why this made it work for you. Closing again. Feedback on whether the fix works for anyone still appreciated. Thanks. |
@chrmarti are there verification steps for this? |
Steps to verify:
Thanks! |
sorry, forgot to ping back that this fix did solve my problem in insiders is this slated for next stable release since we're at the end of July now :) |
Hi,
according to
![截圖 2023-06-04 21 36 44](https://private-user-images.githubusercontent.com/30332287/243181282-2bc7064c-176b-406d-ab20-24ffb51fb94a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0OTc5ODcsIm5iZiI6MTczOTQ5NzY4NywicGF0aCI6Ii8zMDMzMjI4Ny8yNDMxODEyODItMmJjNzA2NGMtMTc2Yi00MDZkLWFiMjAtMjRmZmI1MWZiOTRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDAxNDgwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcxMDk4NjY1NDJmMGVlMjJiMTgwNjI4ODYxMjhiM2NhMzQzNWNkNTE0YmZjNDk1MGU1YjdhYjI2YWIwNGU2MWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.M1U9QZrrtg0WDo9EbK4aKfXzA52sdtUzB5RaUUq6gpY)
https://github.com/microsoft/pylance-release/issues/4443#issuecomment-1572595906
so create a new issue, not duplicate https://github.com/microsoft/vscode/issues/183546#issuecomment-1565902320
![截圖 2023-06-04 21 35 26](https://private-user-images.githubusercontent.com/30332287/243181309-770b18f6-8be3-4ce0-a4de-7f47b0824a2f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0OTc5ODcsIm5iZiI6MTczOTQ5NzY4NywicGF0aCI6Ii8zMDMzMjI4Ny8yNDMxODEzMDktNzcwYjE4ZjYtOGJlMy00Y2UwLWE0ZGUtN2Y0N2IwODI0YTJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDAxNDgwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY2ZDg1NGYzY2I5ZTg4Yzc2YTI3Nzg1MTI1N2E1ZjM2NTZkMmFjMzM1M2YyMjMwMjQ2ODg5MGUxYzVmY2VmYTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.LOESapW0gPe0CtvHWnl311ni9Xhbw3ySY-jAPOFDczo)
plz don't closed again.
Type: Bug
VSCode can't login
Step:
click login > microfoft > edge > login > success,
But always not!
Here is log
2023-05-26 21:57:58.847 [error] Network failure: Error: Network failure
at f.G (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js:2:556571)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at f.F (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js:2:555729)
at f.p (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js:2:549116)
at f.createSession (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js:2:548195)
at Object.createSession (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js:2:988955)
2023-05-26 22:13:36.139 [error] SyntaxError: Unexpected token '�', "��p[*���PC"... is not valid JSON
at JSON.parse ()
at e.MainThreadSecretState.$getPassword (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1525:48130)
VS Code version: Code 1.78.2 (Universal) (https://github.com/microsoft/vscode/commit/b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:44:45.204Z)
OS version: Darwin x64 19.6.0
Modes:
Sandboxed: Yes
Even clean broswer cache, still error.
023-05-29 21:36:30.596 [info] Getting sessions for the following scopes: email offline_access openid profile
2023-05-29 21:36:30.596 [trace] No session found with idtoken scopes... Using fallback scope list of: email offline_access openid profile
2023-05-29 21:36:30.596 [info] Got 0 sessions for scopes: email offline_access openid profile
2023-05-29 21:36:36.037 [info] Logging in for the following scopes: email offline_access openid profile
2023-05-29 21:36:41.136 [info] Exchanging login code for token for scopes: email offline_access openid profile
2023-05-29 21:36:46.381 [error] Fetching token failed for scopes (email offline_access openid profile): request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token failed, reason: certificate has expired
2023-05-29 21:36:46.381 [error] Error exchanging code for token (for scopes email offline_access openid profile): Error: Network failure
2023-05-29 21:36:46.381 [error] Error creating session for scopes: email offline_access openid profile Error: Error: Network failure
2023-05-29 21:37:21.044 [error] Fetching token failed for scopes (email offline_access openid profile): request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token failed, reason: certificate has expired
2023-05-29 21:37:21.044 [error] Error exchanging code for token (for scopes email offline_access openid profile): Error: Network failure
2023-05-29 21:37:21.044 [error] Error creating session for scopes: email offline_access openid profile Error: Error: Network failure
2023-05-29 21:37:51.804 [error] Fetching token failed for scopes (email offline_access openid profile): request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token failed, reason: certificate has expired
2023-05-29 21:37:51.804 [error] Error exchanging code for token (for scopes email offline_access openid profile): Error: Network failure
2023-05-29 21:37:51.804 [error] Error creating session for scopes: email offline_access openid profile Error: Error: Network failure
2023-05-29 21:39:21.684 [info] Getting sessions for the following scopes: email offline_access openid profile
2023-05-29 21:39:21.684 [trace] No session found with idtoken scopes... Using fallback scope list of: email offline_access openid profile
2023-05-29 21:39:21.684 [info] Got 0 sessions for scopes: email offline_access openid profile
2023-05-29 21:39:24.955 [info] Logging in for the following scopes: email offline_access openid profile
2023-05-29 21:39:32.391 [info] Exchanging login code for token for scopes: email offline_access openid profile
2023-05-29 21:40:43.049 [error] Fetching token failed for scopes (email offline_access openid profile): request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token failed, reason: certificate has expired
I try everything about other solution.
If uninstall reboot install
![image](https://private-user-images.githubusercontent.com/30332287/243181483-415ff326-f7fd-4e2d-9021-0a325dce83f8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0OTc5ODcsIm5iZiI6MTczOTQ5NzY4NywicGF0aCI6Ii8zMDMzMjI4Ny8yNDMxODE0ODMtNDE1ZmYzMjYtZjdmZC00ZTJkLTkwMjEtMGEzMjVkY2U4M2Y4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDAxNDgwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBhZDk4ZTRhMjdlZGRkMjg1ZWY2MWI2NDQ0OTRkYTdkNzI2NmIxMzJlZmRhMzAxNTUwZjMwODJjYTc0MDU1MGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wTdGvhpiwL4F8WdHyH281uVC3-2rhniq74TIfvRXZTQ)
It always show this, but this is before settings
always
023-05-29 21:36:30.596 [info] Getting sessions for the following scopes: email offline_access openid profile 2023-05-29 21:36:30.596 [trace] No session found with idtoken scopes... Using fallback scope list of: email offline_access openid profile 2023-05-29 21:36:30.596 [info] Got 0 sessions for scopes: email offline_access openid profile 2023-05-29 21:36:36.037 [info] Logging in for the following scopes: email offline_access openid profile 2023-05-29 21:36:41.136 [info] Exchanging login code for token for scopes: email offline_access openid profile 2023-05-29 21:36:46.381 [error] Fetching token failed for scopes (email offline_access openid profile): request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token failed, reason: certificate has expired 2023-05-29 21:36:46.381 [error] Error exchanging code for token (for scopes email offline_access openid profile): Error: Network failure 2023-05-29 21:36:46.381 [error] Error creating session for scopes: email offline_access openid profile Error: Error: Network failure 2023-05-29 21:37:21.044 [error] Fetching token failed for scopes (email offline_access openid profile): request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token failed, reason: certificate has expired 2023-05-29 21:37:21.044 [error] Error exchanging code for token (for scopes email offline_access openid profile): Error: Network failure 2023-05-29 21:37:21.044 [error] Error creating session for scopes: email offline_access openid profile Error: Error: Network failure 2023-05-29 21:37:51.804 [error] Fetching token failed for scopes (email offline_access openid profile): request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token failed, reason: certificate has expired 2023-05-29 21:37:51.804 [error] Error exchanging code for token (for scopes email offline_access openid profile): Error: Network failure 2023-05-29 21:37:51.804 [error] Error creating session for scopes: email offline_access openid profile Error: Error: Network failure 2023-05-29 21:39:21.684 [info] Getting sessions for the following scopes: email offline_access openid profile 2023-05-29 21:39:21.684 [trace] No session found with idtoken scopes... Using fallback scope list of: email offline_access openid profile 2023-05-29 21:39:21.684 [info] Got 0 sessions for scopes: email offline_access openid profile 2023-05-29 21:39:24.955 [info] Logging in for the following scopes: email offline_access openid profile 2023-05-29 21:39:32.391 [info] Exchanging login code for token for scopes: email offline_access openid profile 2023-05-29 21:40:43.049 [error] Fetching token failed for scopes (email offline_access openid profile): request to https://login.microsoftonline.com/organizations/oauth2/v2.0/token failed, reason: certificate has expire
reason: certificate has expire
But keychain has no about vscode (deleted before)
Thanks a lot.
The text was updated successfully, but these errors were encountered: