Giter Club home page Giter Club logo

Comments (6)

fafhrd91 avatar fafhrd91 commented on July 17, 2024 1

fixed, ntex-tls 0.1.5 is released

from ntex.

karlhelgason avatar karlhelgason commented on July 17, 2024

Here is an example code that hangs on current version of ntex (0.5.15), but works with the changes above.

            let mut cert_store = rustls::RootCertStore::empty();
            cert_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(
                |ta| {
                    rustls::OwnedTrustAnchor::from_subject_spki_name_constraints(
                        ta.subject,
                        ta.spki,
                        ta.name_constraints,
                    )
                },
            ));
            let config = ClientConfig::builder()
                .with_safe_defaults()
                .with_root_certificates(cert_store)
                .with_no_client_auth();
            let _ = ntex::connect::rustls::Connector::<&'static str>::new(config.clone()).clone();
            let factory = ntex::connect::rustls::Connector::from(Arc::new(config)).memory_pool(ntex::util::PoolId::P5);

            let srv = ntex::ServiceFactory::new_service(&factory, ()).await.unwrap();
            // always ready
            assert!(futures::future::lazy(|cx| ntex::Service::poll_ready(&srv, cx)).await.is_ready());
            let result = ntex::Service::call(&srv, ntex::connect::Connect::new("testing.servicebus.windows.net:5671"))
                .await;
            assert!(result.is_ok());

from ntex.

karlhelgason avatar karlhelgason commented on July 17, 2024

On further testing it also hangs when connecting to other https websites.

from ntex.

karlhelgason avatar karlhelgason commented on July 17, 2024

After more testings, it only hangs against some websites, not all.

www.rust-lang.org:443 works
testing.servicebus.windows.net:443 hangs (works in browser)
testing.servicebus.windows.net:5671 hangs

from ntex.

fafhrd91 avatar fafhrd91 commented on July 17, 2024

thanks for report!

from ntex.

karlhelgason avatar karlhelgason commented on July 17, 2024

I can also confirm it works :)

from ntex.

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.