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-cli | |
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-cli')
0 files changed, 0 insertions, 0 deletions