feat(server,net): Add TLS/SSL support serverside

Implements the missing enum cases in Http* and adds a new
method to the default Server implementation to take advantage
of the new TLS support

Closes #1
This commit is contained in:
Kelvin Ly
2015-01-11 22:10:43 -05:00
parent 9fbf0aecb8
commit c6eef68124
2 changed files with 35 additions and 8 deletions

View File

@@ -46,6 +46,10 @@ impl Server<HttpListener> {
pub fn http(ip: IpAddr, port: Port) -> Server {
Server::with_listener(ip, port, HttpListener::Http)
}
/// Creates a new server that will handler `HttpStreams`s using a TLS connection.
pub fn https(ip: IpAddr, port: Port, cert: Path, key: Path) -> Server {
Server::with_listener(ip, port, HttpListener::Https(cert, key))
}
}
impl<