1 unstable release

Uses old Rust 2015

0.0.1 Jul 13, 2017

#6 in #hyper-rustls

MIT/Apache/ISC

17KB
156 lines

hyper-rustls

This is an integration between the rustls TLS stack and the hyper HTTP library.

Build Status Crate

API Documentation

By default clients verify certificates using the webpki-roots crate, which includes the Mozilla root CAs.

License

hyper-rustls is distributed under the following three licenses:

  • Apache License version 2.0.
  • MIT license.
  • ISC license.

These are included as LICENSE-APACHE, LICENSE-MIT and LICENSE-ISC respectively. You may use this software under the terms of any of these licenses, at your option.


lib.rs:

hyper-rustls

A pure-Rust HTTPS connector for hyper, based on Rustls.

Example

extern crate hyper;
extern crate hyper_rustls;
extern crate tokio_core;

use hyper::{Client, Uri};
use tokio_core::reactor;

fn main() {
    let mut core = reactor::Core::new().unwrap();
    let url = ("https://hyper.rs").parse().unwrap();

    let client = hyper::Client::configure()
        .connector(hyper_rustls::HttpsConnector::new(4, &core.handle()))
        .build(&core.handle());

    let res = core.run(client.get(url)).unwrap();
    assert_eq!(res.status(), hyper::Ok);
}

Dependencies

~15–25MB
~420K SLoC