diff options
author | Jannis <jannis@thegraph.com> | 2019-04-04 13:47:38 +0200 |
---|---|---|
committer | Jannis <jannis@thegraph.com> | 2019-04-04 13:47:38 +0200 |
commit | d37d58a1b183181618b1e145ab109bf6d0366345 (patch) | |
tree | d43f66641044b28447f26f43791793b573837586 /ipfs-api/Cargo.toml | |
parent | 9808b3dc6b7e837a47e2c1c56b6d64a8df03646b (diff) |
ipfs-api: Add hyper_tls for added HTTPS support
The `HttpsConnector` provided by hyper-tls supports both HTTP and
HTTPS. Using this instead of the default `HttpConnector` allows to
use the IpfsClient against HTTPS endpoints such as
https://ipfs.infura.io:5001.
To make creating an IpfsClient with an HTTPS URI possible, this
commit adds a new constructor for `IpfsClient`:
```rust
struct IpfsClient {
...
pub fn new_from_uri(uri: &str) -> Result<IpfsClient, InvalidUri> {
....
}
}
```
The existing `IpfsClient::new` constructor is updated to use this.
Tested with the current `ipfs-cli` as well as changing `ipfs-cli`
to use `IpfsClient::new_from_uri("https://ipfs.infura.io:5001")`
instead of `IpfsClient::default()`. Both work.
Diffstat (limited to 'ipfs-api/Cargo.toml')
-rw-r--r-- | ipfs-api/Cargo.toml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ipfs-api/Cargo.toml b/ipfs-api/Cargo.toml index be56b84..a1fb349 100644 --- a/ipfs-api/Cargo.toml +++ b/ipfs-api/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT OR Apache-2.0" travis-ci = { repository = "ferristseng/rust-ipfs-api" } [features] -default = ["hyper", "hyper-multipart-rfc7578"] +default = ["hyper", "hyper-multipart-rfc7578", "hyper-tls"] actix = ["actix-web", "actix-multipart-rfc7578"] [dependencies] @@ -25,6 +25,7 @@ failure = "0.1.2" futures = "0.1" http = "0.1" hyper = { version = "0.12", optional = true } +hyper-tls = { version = "0.3.2", optional = true } hyper-multipart-rfc7578 = { version = "0.3", optional = true } serde = "1.0" serde_derive = "1.0" @@ -41,5 +42,6 @@ multiaddr = "0.3.1" actix-multipart-rfc7578 = "0.1" actix-web = "0.7" hyper = "0.12" +hyper-tls = "0.3.2" tokio-timer = "0.2" tar = "0.4" |