We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d83ed6 commit 1a076d1Copy full SHA for 1a076d1
src/net.rs
@@ -164,6 +164,11 @@ impl HttpListener {
164
try!(ssl_context.set_certificate_file(cert, X509FileType::PEM).map_err(lift_ssl_error));
165
try!(ssl_context.set_private_key_file(key, X509FileType::PEM).map_err(lift_ssl_error));
166
ssl_context.set_verify(SSL_VERIFY_NONE, None);
167
+ HttpListener::https_with_context(addr, ssl_context)
168
+ }
169
+
170
+ /// Start listening to an address of HTTPS using the given SslContext
171
+ pub fn https_with_context<To: ToSocketAddrs>(addr: To, ssl_context: SslContext) -> io::Result<HttpListener> {
172
Ok(HttpListener::Https(try!(TcpListener::bind(addr)), Arc::new(ssl_context)))
173
}
174
0 commit comments