-
Notifications
You must be signed in to change notification settings - Fork 168
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
InvalidDNSNameError when using https with IP address #393
Comments
Thanks for the report. This happens because rustls, the TLS library we use,
doesn't support IP address certificates.
There are a few different possibilities. For a "works today" approach:
Set a custom DNS resolver in the builder that resolves everything to that
IP address, and also set a custom rustls::ClientConfig that specifies a
custom certificate verifier that accepts all certificates. Then, when
making requests, use an arbitrary hostname instead of the IP address. This
is fairly hacky and won't support redirects.
Alternate approach: wait a little for an upcoming release in which we will
support native-tla, which can do IP address certificates. We have a PR out,
it should be soon.
…On Fri, Jun 11, 2021, 05:02 Alex Ellwein ***@***.***> wrote:
Given this example
fn main() {
match ureq::post("https://172.217.16.142").send_string("test") {
Err(e) => println!("{:?}", e),
Ok(r) => println!("response was: {:?}", r),
}
}
The result is always an error, looks like this:
Transport(Transport { kind: Dns, message: None, url: Some(Url { scheme: "https", username: "", password: None, host: Some(Ipv4(172.217.16.142)), port: None, path: "/", query: None, fragment: None }), source: Some(InvalidDNSNameError), response: None })
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#393>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABVYLKQAD3AGVLAJI2L2KDTSH26ZANCNFSM46QST4NA>
.
|
The Closing this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given this example
The result is always an error, looks like this:
The text was updated successfully, but these errors were encountered: