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

invalid peer certificate: UnknownIssuer #146

Closed
drpdishant opened this issue Nov 9, 2022 · 13 comments
Closed

invalid peer certificate: UnknownIssuer #146

drpdishant opened this issue Nov 9, 2022 · 13 comments
Labels
bug Something isn't working

Comments

@drpdishant
Copy link

drpdishant commented Nov 9, 2022

Just installed tea and facing this error while I try to install any package

tea +openssl.org
error: http (spilt-tea-404)
error sending request for url (https://dist.tea.xyz/openssl.org/darwin/aarch64/versions.txt): error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer

sh <(curl tea.xyz) +nodejs.org
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  8739  100  8739    0     0  14750      0 --:--:-- --:--:-- --:--:-- 14938
error: http (spilt-tea-404)
error sending request for url (https://dist.tea.xyz/unicode.org/darwin/aarch64/versions.txt): error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer

seems like its not able to validate server certificate against a root certificate from the trust store.
How can I disable ssl check?

@mxcl
Copy link
Member

mxcl commented Nov 9, 2022

wow. @jhheider ideas?

@mxcl
Copy link
Member

mxcl commented Nov 9, 2022

so, deno controls this, LMK check their GitHub.

@mxcl
Copy link
Member

mxcl commented Nov 9, 2022

@jhheider
Copy link
Contributor

jhheider commented Nov 9, 2022

This is interesting. @drpdishant , what OS/platform/distro are you running this under? Interestingly, if I load debian:buster-slim in Docker, and apt remove ca-certificates, I break curl, but not tea. Which makes me think, somewhere in the Deno guts, it's falling back to some well-known paths looking for ca certs, and possibly finding out of date ones.

That said, it doesn't really explain why you can curl tea.xyz. Can you curl dist.tea.xyz? If I can recreate this, it should be possible to strace the run and see what it's trying to execute.

@mxcl
Copy link
Member

mxcl commented Nov 9, 2022

https://dist.tea.xyz/openssl.org/darwin/aarch64/versions.txt

@jhheider which is mysterious right? How can certs on macOS be broken.

@jhheider
Copy link
Contributor

jhheider commented Nov 9, 2022

Oh, yeah. Deeply mysterious. Unless it's extremely out of date. I know the CAs do have big changes periodically. I feel like AWS had one in the last 12 months, maybe.

@drpdishant
Copy link
Author

@mxcl @jhheider dist.tea.xyz is accessible in browser but it serves with a different certificate than the actual, probably because all the connection from my machine go through a corporate proxy. I do face this issue when running npm install, and it works after setting env NODE_TLS_REJECT_UNAUTHORIZED to 0.

image

image

Definitely it isn't an issue with macOS or ca-certs or even tea cli, skipping the check will work.

@jhheider
Copy link
Contributor

Ahhhhh, yes, a proxy performing the SSL check on your behalf and serving using its certificate would definitely cause that. Hm. Will have to see what options Deno offers for accepting insecure connections.

@drpdishant
Copy link
Author

@jhheider If this helps, denoland/deno#11324

@drpdishant
Copy link
Author

drpdishant commented Nov 10, 2022

@jhheider I am able to figure out a workaround using env DENO_CERT, downloaded the ca cert and provided in the env value. it works.

DENO_CERT=dist-tea-xyz.pem tea +openssl.org

@jhheider
Copy link
Contributor

Certainly one workaround. We'll noodle something more user friendly. You won't be the last one behind a corporate proxy.

@mxcl
Copy link
Member

mxcl commented Nov 10, 2022

One way brew avoided this sort of thing is using curl to do the downloads. Since generally, curl has been configured to work for the user.

@mxcl mxcl added the bug Something isn't working label Dec 6, 2022
@mxcl
Copy link
Member

mxcl commented Jun 7, 2023

We haven't seen this in a long time, closing as assumed deno is responsible and is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants