Code Monkey home page Code Monkey logo

Comments (8)

sfackler avatar sfackler commented on August 16, 2024

Does it work on OpenSSL without that configuration? Do you want to require client certificates?

from rust-native-tls.

bluejekyll avatar bluejekyll commented on August 16, 2024

No, it doesn't work with or without that configuration. That was an example of some of the steps I've taken to try and workaround the issue. The error that I mentioned is coming from the server acceptor in the test (standard blocking version). From my understanding it is saying that it is a client validation error, which is why I started looking at different options for disabling validation on the server side.

Eventually I do want client-auth, but not right now.

The out-of-the-box setup works for macOS, just not linux. I am using a self-signed cert, the logic for that is a few lines up:

https://github.com/bluejekyll/trust-dns/blob/dns_over_tls/client/src/tls/tls_stream.rs#L251

from rust-native-tls.

sfackler avatar sfackler commented on August 16, 2024

It looks like OpenSSL will verify client certificates sent to it even if they haven't been requested. Either not sending the client cert or configuring the server's trust root to include the client cert's CA should fix things.

from rust-native-tls.

sfackler avatar sfackler commented on August 16, 2024

You can also disable certificate verification on the server side with set_verify(SSL_VERIFY_NONE).

from rust-native-tls.

bluejekyll avatar bluejekyll commented on August 16, 2024

Yeah. I tried that and am not sending a client cert. I'll make an isolated test case.

from rust-native-tls.

bluejekyll avatar bluejekyll commented on August 16, 2024

Ok, thanks for the help earlier. I think I figured out what was going on, but haven't had a chance to fix it yet. The mac version of the TlsConnectorBuilderExt allows for certificate pinning, where-as I was trying to add the CA's dynamically. This led me to passing the wrong type of cert to the openssl version. #21 has a new test for the Connector. It's not ready, but I wanted to show you what I'm talking about. #21 is correct on Linux, but wrong on macOS, this was the inverse of the problem I was having on Linux and is an indication that I was using my certs wrong.

from rust-native-tls.

bluejekyll avatar bluejekyll commented on August 16, 2024

Circling back around on this. I just pushed a solution to this issue in rust-openssl which will allow certs to be associated in the same way as I wanted to use them here.

sfackler/rust-openssl#582

This can be closed with the solution being to use SslContextBuilder::set_verify_cert_store(), which matches the functionality of TlsConnectorBuilderExt::anchor_certificates() on macOS.

from rust-native-tls.

sfackler avatar sfackler commented on August 16, 2024

Sweet, closing in favor of that!

from rust-native-tls.

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.