Giter Club home page Giter Club logo

Comments (7)

blackbeam avatar blackbeam commented on July 29, 2024

Hi!

Yes, documentation was accidentally copied from rust-mysql-simple.

I suspect that adding support would just involve adapting the appropriate pieces of SSL code from rust-mysql-simple.

Yes. It should not be a problem with tokio-tls crate. I believe i'll find time for this on next week but if it's too late for you, then you could try to implement it yourself (documentation)

from mysql_async.

kulshrax avatar kulshrax commented on July 29, 2024

Thanks for the quick response! Waiting a week is no big deal for me. Let me know if you end up not having time for this though.

from mysql_async.

blackbeam avatar blackbeam commented on July 29, 2024

It appears to be harder than i thought but now i'm a bit closer (sfackler/rust-native-tls#54).
There's one more issue that needs to be fixed.

from mysql_async.

kulshrax avatar kulshrax commented on July 29, 2024

Hey, I noticed that the latest release of mysql_async now appears to have some SSL support in place. Thank you for working on this!

Given that you haven't yet closed this issue, is there still additional work that you need to do?

Also, I noticed that unlike in rust-mysql-simple, you're using native-tls here, which appears to only accept SSL credentials as PKCS12 archives. (Whereas in rust-mysql-simple, PKCS12 is only used for MacOS clients -- other Unix-like systems need to specify a certificate, private key, and CA certificate chain independently.)

I've been successfully using rust-mysql-simple on Linux in the aforementioned way for a while now. I tried using OpenSSL to convert my certificates and key into a PKCS12 archive and giving that to mysql_async, but attempting to connect to the database fails during certificate verification. I'm pretty sure I'm just going something wrong, but I thought it'd be worth asking if you'd expect SSL to work on Linux clients in this crate's current state.

from mysql_async.

blackbeam avatar blackbeam commented on July 29, 2024

Hi.

Given that you haven't yet closed this issue, is there still additional work that you need to do?

Yeah, ssl on linux is still broken at the moment. I hope to solve this in near future.
Please use rust-mysql-simple with something like futures-cpupool until then.

from mysql_async.

blackbeam avatar blackbeam commented on July 29, 2024

Oh. Well. This one was easyer than i thought.

It turns out that certificate of my custom CA should not go to pkcs12 but should be provided separetely. I've added SslOpts::set_root_cert_path method for this (it is in v0.12.1). But i'm still not sure why everything worked on my mac without it.

Anyway.
This works flawlessly on my linux box:

let mut ssl_opts = SslOpts::new("./test/client.p12".as_ref());
ssl_opts.set_root_cert_path(Some("./test/ca-cert.der".as_ref()));
ssl_opts.set_password(Some("pass"));

from mysql_async.

kulshrax avatar kulshrax commented on July 29, 2024

Cool, I can confirm that SSL now works for me on Linux. Thanks for your quick response!

from mysql_async.

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.