-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
wip: ssl-verify #168
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
wip: ssl-verify #168
Conversation
|
||
/// Access the inner Writer mutably. | ||
/// | ||
/// Warning: You should not write to this directly, as you can corrupt |
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.
unsafe
maybe?
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.
It was following suite to std::io::BufferedReader
, which hasn't marked it as unsafe.
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.
Ok. I think the warning should probably be enough.
Why don't we instead just add another method to |
That would be much easier for us, but much harder for anyone who wants ssl cert checking. I'd hope for: pub struct Client {
pub ssl_verifier: Option<SslVerifier>,
pub redirect_policy: RedirectPolicy,
// ...
} |
What if we changed our trait stack to separate Then, a verification connector could take an |
I was thinking that would be nice, so then people could continue to use So, I would then use 2 different connectors for the |
|
eb3a8c6
to
927c77c
Compare
@reem updated with the newer design. |
and its green! |
struct MockConnector; | ||
|
||
impl net::NetworkConnector<MockStream> for MockConnector { | ||
fn connect<To: ToSocketAddr>(&mut self, _addr: To, _scheme: &str) -> IoResult<MockStream> { | ||
Ok(MockStream::new()) | ||
} | ||
|
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.
extra newline here
This looks good with those nits addressed. |
Instead, you can use an instance of a NetworkConnector with `Request::with_connector`. This allows overloading of the NetworkStream constructors, so that it is easy to modify how an `HttpStream` is created, while still relying on the rest of the stream implementation. BREAKING CHANGE
927c77c
to
36429ab
Compare
Instead, you can use an instance of a NetworkConnector with
Request::with_connector
. This allows overloading of the NetworkStreamconstructors, so that it is easy to modify how an
HttpStream
iscreated, while still relying on the rest of the stream implementation.