summaryrefslogtreecommitdiff
path: root/src/net.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-08-28 13:49:19 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-08-30 08:29:28 -0400
commitd8d5c421c33b1cc5416ff87f6a7c3837e5176d4d (patch)
treee43b4ae5a48f465d54f6d229f0edde131d84823c /src/net.rs
parent11896647e6a31122ee8c015e2cc6093e448029d6 (diff)
Support https imports.
Adds hyper-rustls to the build. Use ring for sha1 instead of "ssh1" crate. Fixes #528.
Diffstat (limited to 'src/net.rs')
-rw-r--r--src/net.rs6
1 files changed, 5 insertions, 1 deletions
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<String> {
let url = module_name.parse::<Uri>().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();