File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 30
30
//!
31
31
//! ```ignore
32
32
//! use ftp::FtpStream;
33
+ //! use openssl::ssl::*;
34
+ //!
33
35
//! let mut ftp_stream = FtpStream::connect("127.0.0.1:21").unwrap();
36
+ //! let mut ctx = SslContext::new(SslMethod::Sslv23).unwrap();
37
+ //! let mut ssl = Ssl::new(&ctx).unwrap();
34
38
//! // Switch to the secure mode
35
- //! let ( mut ftp_stream, _) = ftp_stream.secure ();
39
+ //! let mut ftp_stream = ftp_stream.into_secure(ssl).unwrap ();
36
40
//! ftp_stream.login("anonymous", "anonymous").unwrap();
37
41
//! // Do other secret stuff
38
42
//! // Switch back to the insecure mode (if required)
39
- //! let ( mut ftp_stream, _) = ftp_stream.insecure ();
43
+ //! let mut ftp_stream = ftp_stream.into_insecure().unwrap ();
40
44
//! // Do all public stuff
41
45
//! let _ = ftp_stream.quit();
42
46
//! ```
You can’t perform that action at this time.
0 commit comments