@@ -202,6 +202,20 @@ impl Write for HttpStream {
202202 }
203203}
204204
205+ #[ cfg( windows) ]
206+ impl :: std:: os:: windows:: io:: AsRawSocket for HttpStream {
207+ fn as_raw_socket ( & self ) -> :: std:: os:: windows:: io:: RawSocket {
208+ self . 0 . as_raw_socket ( )
209+ }
210+ }
211+
212+ #[ cfg( unix) ]
213+ impl :: std:: os:: unix:: io:: AsRawFd for HttpStream {
214+ fn as_raw_fd ( & self ) -> i32 {
215+ self . 0 . as_raw_fd ( )
216+ }
217+ }
218+
205219impl NetworkStream for HttpStream {
206220 #[ inline]
207221 fn peer_addr ( & mut self ) -> io:: Result < SocketAddr > {
@@ -439,16 +453,13 @@ mod openssl {
439453 type Stream = SslStream < HttpStream > ;
440454
441455 fn wrap_client ( & self , stream : HttpStream , host : & str ) -> :: Result < Self :: Stream > {
442- //if let Some(ref verifier) = self.verifier {
443- // verifier(&mut context);
444- //}
445456 let ssl = try!( Ssl :: new ( & self . context ) ) ;
446457 try!( ssl. set_hostname ( host) ) ;
447- SslStream :: new_from ( ssl, stream) . map_err ( From :: from)
458+ SslStream :: connect ( ssl, stream) . map_err ( From :: from)
448459 }
449460
450461 fn wrap_server ( & self , stream : HttpStream ) -> :: Result < Self :: Stream > {
451- match SslStream :: new_server ( & self . context , stream) {
462+ match SslStream :: accept ( & * self . context , stream) {
452463 Ok ( ssl_stream) => Ok ( ssl_stream) ,
453464 Err ( SslIoError ( e) ) => {
454465 Err ( io:: Error :: new ( io:: ErrorKind :: ConnectionAborted , e) . into ( ) )
0 commit comments