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

Deno.connectTls panics when given invalid hostname #9452

Closed
erik opened this issue Feb 9, 2021 · 0 comments · Fixed by #9453
Closed

Deno.connectTls panics when given invalid hostname #9452

erik opened this issue Feb 9, 2021 · 0 comments · Fixed by #9453
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@erik
Copy link
Contributor

erik commented Feb 9, 2021

Culprit is a call to .expect() in both connectTls and startTls. Should be a regular exception instead of a panic.

Trivial repro:

> await Deno.connectTls({hostname: '8.8.8.8', port: 443})
thread 'main' panicked at 'Invalid DNS lookup: InvalidDNSNameError', runtime/ops/tls.rs:208:45
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Object({"id": Number(2), "error": Object({"code": Number(-32000), "message": String("Execution context was destroyed.")})})', runtime/inspector.rs:978:8
stack backtrace:
...
@kitsonk kitsonk added bug Something isn't working correctly cli related to cli/ dir labels Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants