aatxe / irc

the irc crate – usable, async IRC for Rust
Mozilla Public License 2.0
531 stars 97 forks source link

Update conn.rs #39

Closed ghost closed 8 years ago

ghost commented 8 years ago

Updated to Tlsv1_2 and changed deprecated SSlStream::new to SslStream::connect_generic

aatxe commented 8 years ago

I'm confused. Why did you change the name of the feature everywhere?

ghost commented 8 years ago

https://sfackler.github.io/rust-openssl/doc/v0.6.7/openssl/ssl/enum.SslMethod.html

I wanted to use Tlsv1_2, I had errors when I attempted to change connect_generic from Tlsv1 to Tlsv1_2 and changing the feature name fixed it.

aatxe commented 8 years ago

The Tlsv1_2 feature doesn't exist in my library. Have you actually tried using this? I'm fairly certain it'll always panic with the SSL not supported error. If you check a newer version of the OpenSSL docs, you'll see this:

Support TLSv1.2 protocol, requires the tlsv1_2 feature.

So, the OpenSSL dependency needs to have that feature set. There shouldn't be checks for it in this library though.

aatxe commented 8 years ago

Here's the result of running the simple SSL example on your fork:

     Running `target/debug/examples/simple_ssl`
thread '<main>' panicked at 'Cannot connect to irc.fyrechat.net:6697 over SSL without compiling with SSL support.', src/client/conn.rs:62
Process didn't exit successfully: `target/debug/examples/simple_ssl` (exit code: 101)
ghost commented 8 years ago

Right on, sorry I've goofed here pretty badly.

aatxe commented 8 years ago

No worries. I'll add the tlsv1_2 feature requirement and enable that. Did you want this because you were having issues connecting to some server without it?

aatxe commented 8 years ago

Actually, it seems that TLSv1.2 is incompatible with most, if not all, IRCds.

ghost commented 8 years ago

Yeah I really goofed here. Got carried away when I was trying to fix the ::new(), sorry. Thanks for fixing the deprecated function.