# Https and IPFS - Is SSL needed with IPFS?

**URL:** <https://discuss.ipfs.tech/t/https-and-ipfs-is-ssl-needed-with-ipfs/186>\
**Category:** Help\
**Tags:** js-ipfs\
**Created:** [May 5, 2017, 1:49am UTC](https://discuss.ipfs.tech/t/https-and-ipfs-is-ssl-needed-with-ipfs/186 "2017-05-05T01:49:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zillerium](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zillerium/32/2811_2.png) [@zillerium](https://discuss.ipfs.tech/u/zillerium)\
**Post date:** [May 5, 2017, 1:49am UTC](https://discuss.ipfs.tech/t/https-and-ipfs-is-ssl-needed-with-ipfs/186/1 "2017-05-05T01:49:54Z")

</div>

I am testing a new demo and I have an error saying IPFS needs https. Someone I know also testing said they did not need http. I am using nginx and I have two servers. I am also trying to add data.

I cannot seem to find a clear answer from the docs.

Is https needed for IPFS?

---

<div class="post-metadata">

**Author:** ![Mateon1](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mateon1](https://discuss.ipfs.tech/u/Mateon1)\
**Post date:** [May 5, 2017, 6:43am UTC](https://discuss.ipfs.tech/t/https-and-ipfs-is-ssl-needed-with-ipfs/186/2 "2017-05-05T06:43:07Z")

</div>

You do not need to use HTTPS to access your gateway or API, you can use unencrypted HTTP, but the public gateways force HTTPS.

---

<div class="post-metadata">

**Author:** ![zillerium](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zillerium/32/2811_2.png) [@zillerium](https://discuss.ipfs.tech/u/zillerium)\
**Post date:** [May 5, 2017, 8:44am UTC](https://discuss.ipfs.tech/t/https-and-ipfs-is-ssl-needed-with-ipfs/186/3 "2017-05-05T08:44:23Z")

</div>

I am getting errors using what I think is the API as follows -  
App.js:239 ipfs add error DOMException: Only secure origins are allowed (see: [https://goo.gl/Y0ZkNV](https://goo.gl/Y0ZkNV)).

My code -  
var zstr = ‘hello world from Zillerium2’  
this.IpfsAPI.add(new Buffer(zstr), function (err, res){

Is this likely to be a config error in my setup or do I need https? I have tried using https but I am getting a lot of nodejs conflicts.

---

<div class="post-metadata">

**Author:** ![lidel](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/lidel/32/9853_2.png) [@lidel](https://discuss.ipfs.tech/u/lidel)\
**Post date:** [May 5, 2017, 1:50pm UTC](https://discuss.ipfs.tech/t/https-and-ipfs-is-ssl-needed-with-ipfs/186/4 "2017-05-05T13:50:17Z")

</div>

What URL did you provide when creating `this.IpfsAPI` object?

---

<div class="post-metadata">

**Author:** ![zillerium](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zillerium/32/2811_2.png) [@zillerium](https://discuss.ipfs.tech/u/zillerium)\
**Post date:** [May 5, 2017, 7:04pm UTC](https://discuss.ipfs.tech/t/https-and-ipfs-is-ssl-needed-with-ipfs/186/5 "2017-05-05T19:04:37Z")

</div>

I am using the IP address - this.IpfsAPI = IpfsAPI(‘162.243.237.41’, ‘5001’)

I have two servers - one for IPFS and one for the ReactJS. ReactJS is under [jenbil.com](http://jenbil.com) and he IPFS has no domain name. I have this running -  
root@ubuntu-2gb-nyc2-01:/home/zipfs# ipfs daemon  
Initializing daemon…  
Adjusting current ulimit to 2048…  
Successfully raised file descriptor limit to 2048.  
Swarm listening on /ip4/10.13.0.5/tcp/4001  
Swarm listening on /ip4/127.0.0.1/tcp/4001  
Swarm listening on /ip4/162.243.237.41/tcp/4001  
Swarm listening on /ip4/162.243.237.41/tcp/4001  
Swarm listening on /ip6/::1/tcp/4001  
API server listening on /ip4/0.0.0.0/tcp/5001  
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8180  
Daemon is ready

---

<div class="post-metadata">

**Author:** ![lidel](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/lidel/32/9853_2.png) [@lidel](https://discuss.ipfs.tech/u/lidel)\
**Post date:** [May 6, 2017, 6:54pm UTC](https://discuss.ipfs.tech/t/https-and-ipfs-is-ssl-needed-with-ipfs/186/6 "2017-05-06T18:54:58Z")

</div>

Looks like you are using Service Worker(?) or something similar somewhere in your code.

I may be missing something, but last time i checked similar setup it only accepted HTTP with localhost IP (`127.0.0.1`). For anything else TLS was required.

So either set up TLS or run IPFS API on the same hostname&port as your app (can be done with reverse proxy such as Nginx).

Keep in mind that exposing API port to the public internet is a huge security risk. Anyone can upload or pin anything to your node. It is generally a better idea to hide API by tying it to localhost and orchestrating it via custom backend code that provides authorization etc.

---

<div class="post-metadata">

**Author:** ![zillerium](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zillerium/32/2811_2.png) [@zillerium](https://discuss.ipfs.tech/u/zillerium)\
**Post date:** [May 7, 2017, 3:19am UTC](https://discuss.ipfs.tech/t/https-and-ipfs-is-ssl-needed-with-ipfs/186/7 "2017-05-07T03:19:43Z")

</div>

I get a lot of conflicting info about this - I had a lot of npm issues with https and someone from the npm group said that https was not needed for API calls. I am not sure myself. But whatever I try seems to fail. I added a new server to reduce the loan on my current one as I have only small servers at digital ocean.

I get X-Stream error (as posted). I have progressed past some of the errors before but this X-Stream error seems especially elusive.
