Git Product home page Git Product logo

Comments (8)

mcobzarenco avatar mcobzarenco commented on May 15, 2024 11

This seem a pretty major limitation of rustls IMO 😞

from hyper-rustls.

ufoscout avatar ufoscout commented on May 15, 2024 5

@ctz I guess this issue should be kept open to track the possible resolution of the problem.
In a project of my company, we had to move from rustls to openssl due to this. We would be happy to switch back to rustls when this is solved.

from hyper-rustls.

lucab avatar lucab commented on May 15, 2024 2

@ufoscout see #56.

from hyper-rustls.

djc avatar djc commented on May 15, 2024 1

Because it is tracked in #56.

from hyper-rustls.

IThawk avatar IThawk commented on May 15, 2024
let path = "D:\\workSpace\\myrust\\rust-demo\\web_tcp\\config\\sample.pem";
let f = fs::File::open(path)
    .map_err(|e| error(format!("failed to open {}: {}", path, e)))?;
let rds = io::BufReader::new(f);
let mut ca = Some(rds);
// Prepare the HTTPS connector.
println!("读取证书完成");
let https = match ca {
    Some(ref mut rd) => {
        // Build an HTTP connector which supports HTTPS too.
        let mut http = client::HttpConnector::new(4);
        http.enforce_http(false);
        // Build a TLS client, using the custom CA store for lookups.
        let mut tls = rustls::ClientConfig::new();
        tls.root_store
            .add_pem_file(rd)
            .map_err(|_| error("failed to load custom CA store".into()))?;
        // Join the above part into an HTTPS connector.
        hyper_rustls::HttpsConnector::from((http, tls))
    }
    // Default HTTPS connector.

    None => {
        println!("证书有问题!");
        hyper_rustls::HttpsConnector::new(4)
    }
};

from hyper-rustls.

ctz avatar ctz commented on May 15, 2024

The destination must be a hostname, not an IP address. Connecting via an IP address isn't supported currently in the rustls or webpki crates.

from hyper-rustls.

oxlade39 avatar oxlade39 commented on May 15, 2024

I came across this when using rustls + hyper-rustls + hyper-proxy. I think I'm getting this error because the proxy is an IP address.

I'm not sure how to proceed here, it seems a fundamental blocker that the address must be a hostname.
Why's this been closed?

from hyper-rustls.

oxlade39 avatar oxlade39 commented on May 15, 2024

Because it is tracked in #56.

Thank you. I didn't see that.

from hyper-rustls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.