rust-amqp icon indicating copy to clipboard operation
rust-amqp copied to clipboard

Prepare the OpenSSL 1.1 support

Open dereckson opened this issue 7 years ago • 11 comments

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:

  • Error handling has been modified
  • In OpenSSL 1.1, TLS protocol is now TLS_method instead of SSLv23_method, so SslMethod::Sslv23 dosn't exist anymore in openssl crate

dereckson avatar Nov 22 '16 08:11 dereckson

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.

Antti avatar Dec 13 '16 12:12 Antti

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

Keruspe avatar Mar 02 '17 08:03 Keruspe

@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.

Antti avatar Mar 03 '17 10:03 Antti

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

kpcyrd avatar May 23 '17 17:05 kpcyrd

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

steve-chavez avatar May 24 '17 17:05 steve-chavez

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

grahamc avatar Nov 11 '17 23:11 grahamc

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

grahamc avatar Nov 11 '17 23:11 grahamc

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

grahamc avatar Nov 12 '17 02:11 grahamc

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

Antti avatar Nov 12 '17 10:11 Antti

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

grahamc avatar Nov 12 '17 12:11 grahamc

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.

whitfin avatar Feb 20 '18 20:02 whitfin