extern crate iron;
#[cfg(feature = "native-tls-example")]
extern crate hyper_native_tls;
#[cfg(feature = "native-tls-example")]
fn main() {
use hyper_native_tls::NativeTlsServer;
use iron::{Iron, Request, Response};
use iron::status;
use std::result::Result;
let ssl = NativeTlsServer::new("identity.p12", "mypass").unwrap();
match Iron::new(|_: &mut Request| {
Ok(Response::with((status::Ok, "Hello world!")))
}).https("127.0.0.1:3000", ssl) {
Result::Ok(listening) => println!("{:?}", listening),
Result::Err(err) => panic!("{:?}", err),
}
}
#[cfg(not(feature = "native-tls-example"))]
fn main() {
}