-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Upgrading connection to tls in 1.17.x errors with UnsupportedCertVersion #13350
Comments
The exact code works with 1.16.4? Can you please include the self signed certificate, or at least instructions for how to generate a failing certificate / private key? |
Ah sorry, forgot to mention I'm running with |
Even so, it is generated using |
@piscisaureus can you investigate? |
I tested it with this code, and it works for me. import { assertStrictEquals } from "https://deno.land/std/testing/asserts.ts";
const tcp = await Deno.connect({
transport: "tcp",
hostname: "127.0.0.1",
port: 5432,
});
await tcp.write(new Uint8Array([0, 0, 0, 8, 4, 210, 22, 47]));
const buf1 = new Uint8Array(1);
assertStrictEquals(await tcp.read(buf1), 1);
assertStrictEquals(buf1[0], 83);
const tls = await Deno.startTls(tcp, { hostname: "localhost" });
const buf2 = new Uint8Array(1024);
while (await tls.read(buf2) !== null) {
console.log(buf2);
} |
Just tried your code, and I still get the error. Is there anything I can provide you with from my run to help?
|
Can you re-test your test case and confirm that it definitely, without any doubt, works in Deno 1.16.4. I think that you'll find that 1.16.4 also rejects your certificate (although with a different error "InvalidData: invalid certificate: BadDER", due to this recent webpki change). |
Yes, but I only get that error in 1.16.4 if I run without |
It seems that rustls (or webpki) refuses to parse self signed X509 version 1 certificates and rejects them as invalid. When I use a X509v3 certificate it works (provided
I think that is not advisable though, it'd be better to use self signed root CA instead |
More context: |
Ah, well the error was correct then :) I just couldn't find anywhere in the changelog that this should have changed from 16 -> 17, but I suppose it was a dependency change/update that broke/disabled it? If my understanding is correct, this PR briansmith/webpki#219 should fix it? |
I suspect it might have been the rustls 0.19.1 -> 0.20.0 upgrade (which also upgraded webpki 0.21.4 -> 0.22.0): a2f1357. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
My understanding is that this will be fixed with a coming update of webpki, but until that has gone into Deno I don't suppose this issue should be closed? |
Note I see this error message as well, though I'm not using a self-signed cert.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
The following happens when trying to do startTls to a postgres server with a self signed certificate. It works in 1.16.4
Small repro case here:
The text was updated successfully, but these errors were encountered: