AtherEnergy / rumqtt

Pure rust mqtt cilent
The Unlicense
202 stars 71 forks source link

ALPN support #131

Closed eldesh closed 5 years ago

eldesh commented 5 years ago

Added ALPN TLS extension support.

notice

Protocol candidates are represented as Vec<String>, but latest rustls (1.15.0) uses Vec<Vec<u8>>.

tekjar commented 5 years ago

Hi. Thank you for adding this feature. Since this is a breaking change and people already seem to be using this library, I'll release the current version and then merge this

eldesh commented 5 years ago

rebase to master

tekjar commented 5 years ago

Thank you for the patience :). I might have to make ConnetionMethod private and add tls and alpn methods to MqttOptions directly. We'll proceed with the merge for now.

tekjar commented 5 years ago

@eldesh The CI succeeded but I'm facing ring incompatibility in my local build

   --> src/client/network.rs:131:34
    |
131 |             config.set_protocols(&self.alpn_protocols);
    |                                  ^^^^^^^^^^^^^^^^^^^^ expected slice, found struct `std::vec::Vec`
    |
    = note: expected type `&[std::string::String]`
               found type `&std::vec::Vec<std::vec::Vec<u8>>`

Any clue?

eldesh commented 5 years ago

@tekjar How about checking your rustls version which is specified in Cargo.lock. That crate may have changed interface type from String to Vec<u8>.

tekjar commented 5 years ago

Ahh I was somehow assuming lockfile is committed and wondering why CI passes. Thanks

tekjar commented 5 years ago

@eldesh I've removed ConnectionMethod in favor of MqttOptions for connection type here

Can you give this a try and let me know if this works for you?

eldesh commented 5 years ago

@tekjar I have confirmed that f1d9885d997d21755c30fdc8681f5487d3280aa0 works correctly for my use case. Thanks.