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

Fetching any plain ip address over https fails due to rustls error #7796

Closed
junlarsen opened this issue Oct 2, 2020 · 1 comment
Closed
Labels
duplicate a duplicate of another issue

Comments

@junlarsen
Copy link

Related to #7660 and #7789

If we attempt to send a http request to any plain ip over https we receive an 'invalid dnsname' error, this can be demonstrated by running

deno eval "await fetch('https://8.8.8.8')"

which returns the following error

error: Uncaught Http: error sending request for url (https://8.8.8.8/): error trying to connect: invalid dnsname
    at Object.jsonOpAsync (core.js:236:13)
    at async fetch (deno:op_crates/fetch/26_fetch.js:1272:29)
    at async file:///C:/home/$deno$eval.ts:1:1

Deno's fetch implementation uses reqwest to send the http requests, which has been configured to use rustls for the TLS implementation.

This error seems to be a common issue when using rustls as it doesn't want to resolve plain ip addresses over https.

From #7660:

There is currently a limitation using Rustls when sending http requests to plain ip addresses (see rustls/rustls#281) which seems to stem from briansmith/webpki#54

This most likely means the issue stems from a dependency of a dependency of Deno which could take some time to fix as briansmith/webpki#54 hasn't seen any changes for the 3 years the issue has been alive.

Should this be fixed/resolved?

I think this a valid concern and should be discussed because the rfc for X.509 certificates state that ip addresses are valid identifiers plus there are multiple reasons to send requests over https to ip addresses.

RFC 5280, 5.2.2 (https://tools.ietf.org/html/rfc5280#section-5.2.2)

The issuer alternative name extension allows additional identities to be associated with the issuer of the CRL. Defined options include an electronic mail address (rfc822Name), a DNS name, an IP address, and a URI. Multiple instances of a name form and multiple name forms may be included.

Possible Fixes

@kitsonk kitsonk added the duplicate a duplicate of another issue label Oct 3, 2020
@kitsonk
Copy link
Contributor

kitsonk commented Oct 3, 2020

Duplicate of #7660

Let's keep the discussion to one issue. That issue is still open.

@kitsonk kitsonk closed this as completed Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants