Antti / rust-amqp

AMQP client in pure rust. Corresponds to rabbitmq spec.
MIT License
249 stars 45 forks source link

Prepare the OpenSSL 1.1 support #43

Open dereckson opened 8 years ago

dereckson commented 8 years ago

OpenSSL 1.1 is coming on packages, for example it landed on Debian Sid next week.

That calls to bump the openssl crate dependency to 0.9.

As the openssl 0.7 create doesn't support OpensSL 1.1, as soon as an operating system or a Linux distribution bumps to OpenSSL 1.1, it becomes impossible to compile the amqp crate.

The upgrade isn't straightforward, as both the openssl crate and OpenSSL API changed, mostly:

Antti commented 7 years ago

At the moment it's not straight forward to do, because we clone connection for a reading loop and for channel writes. Since openssl v0.9, the try_clone method was removed from the TcpStream wrapper. So now it's impossible to do a concurrent writes/reads from different threads.

Keruspe commented 7 years ago

@Antti Is there any progress on this? Do you need help?

Antti commented 7 years ago

@Keruspe the biggest issue here is that new SslStream does not implement clone or try_clone. Thus making multithreaded reads and writes impossible. I need to completely rewrite frames reading/dispatching code to make it work.

kpcyrd commented 7 years ago

Any news? I've used the amqp crate in one of my projects and I'm not able to compile it anymore because it's pulling in openssl 0.7

steve-chavez commented 7 years ago

Need as well, after an Archlinux upgrade I'm unable to compile the lib.

grahamc commented 7 years ago

@Antti I wonder if I could wrap the connection in a Arc<Mutex<...>> and share the writes with that?

grahamc commented 7 years ago

(without having to rebuild everything else ...) if you're available on IRC, ping me: gchristensen (freenode, mozilla.)

grahamc commented 7 years ago

I have an implementation using the openssl crate version 0.9.x here: https://github.com/Antti/rust-amqp/pull/59

Antti commented 7 years ago

@grahamc Mutex won't work, since it will lock socket for reading as well and will result in the deadlock.

grahamc commented 7 years ago

Yeah, I found that to be true quite quickly :( I used a different approach.

whitfin commented 6 years ago

Not to bug, but is there any movement on this that we can maybe assist on? Currently not possible to use this library alongside Hyper due to clashing openssl crates and neither is compatible with the other.