-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow more generic SSL verification (fixes #244) #249
Conversation
There were the following issues with your Pull Request
Guidelines are available at https://github.com/hyperium/hyper/blob/master/CONTRIBUTING.md This message was auto-generated by https://gitcop.com |
8e44720
to
69d3aeb
Compare
There were the following issues with your Pull Request
Guidelines are available at https://github.com/hyperium/hyper/blob/master/CONTRIBUTING.md This message was auto-generated by https://gitcop.com |
69d3aeb
to
af57785
Compare
This doesn't use unboxed closures yet, because I don't like having to specify a dummy unboxed closure every time. I tried using default type params to get around it, but it didn't work too well and I got an ICE. Any ideas as to how this can be done? |
I don't understand what you mean. I'd likely let set_ssl_verifier be generic over Fn, and then store it as Box. |
@@ -325,7 +328,9 @@ impl NetworkConnector for HttpConnector { | |||
debug!("https scheme"); | |||
let stream = try!(TcpStream::connect(addr)); | |||
let mut context = try!(SslContext::new(Sslv23).map_err(lift_ssl_error)); | |||
self.0.as_ref().map(|cb| context.set_verify(SslVerifyPeer, Some(*cb))); | |||
if let Some(ref v) = self.0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a more descriptive name like verifier
? It's a small change but it brings clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(fixed)
@seanmonstar Oh, I thought "boxed unboxed closures" didn't work yet Added a commit which fixes this |
15390a7
to
bca9a53
Compare
Allow more generic SSL verification (fixes #244)
No description provided.