From d8d5c421c33b1cc5416ff87f6a7c3837e5176d4d Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 28 Aug 2018 13:49:19 -0400 Subject: Support https imports. Adds hyper-rustls to the build. Use ring for sha1 instead of "ssh1" crate. Fixes #528. --- src/net.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/net.rs') diff --git a/src/net.rs b/src/net.rs index fc0df3fa2..7e0700bb6 100644 --- a/src/net.rs +++ b/src/net.rs @@ -1,13 +1,17 @@ use errors::DenoResult; +use hyper; use hyper::rt::{Future, Stream}; use hyper::{Client, Uri}; +use hyper_rustls; use tokio::runtime::current_thread::Runtime; // The CodeFetch message is used to load HTTP javascript resources and expects a // synchronous response, this utility method supports that. pub fn fetch_sync_string(module_name: &str) -> DenoResult { let url = module_name.parse::().unwrap(); - let client = Client::new(); + + let https = hyper_rustls::HttpsConnector::new(4); + let client: Client<_, hyper::Body> = Client::builder().build(https); // TODO Use Deno's RT let mut rt = Runtime::new().unwrap(); -- cgit v1.2.3