I am testing with IPFS and http but I have an error as follows:

App.js:239 ipfs add error DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).

I have this code -

var zstr = 'hello world from Zillerium2'
   this.IpfsAPI.add(new Buffer(zstr), function (err, res){
          if(err || !res) return console.error("ipfs add error", err, res);
            console.log("no issue");
            res.forEach(function(text) {
                   console.log('successfully stored', text.hash);
                 //  console.log('successfully stored', text.path);
                 //  display(file.Hash);
                    var textaddress=text.hash;

I understand from the IPFS forum that https is not needed for API calls, so is there a config to set or something to rid the system of this error?

2 Answers 2


I have discovered that https is not required for access.

This brings back results showing no https was needed -

curl -H "Origin: http://jenbil.com" \
-H "Access-Control-Request-Method: POST" \
-H "Access-Control-Request-Headers: X-Requested-With" \
--verbose \; echo

Also testing with Chrome and the network tab you may see the actual status of calls and that no https was needed.

You do have to make sure ipfs cors are set correctly, and confirm using

ipfs config show

which gives me -

root@ubuntu-2gb-nyc2-01:/home/zipfs/test# ipfs config show
  "API": {
    "HTTPHeaders": {
      "Access-Control-Allow-Credentials": [
      "Access-Control-Allow-Methods": [
      "Access-Control-Allow-Origin": [
  "Addresses": {
    "API": "/ip4/",
    "Gateway": "/ip4/",
   "Swarm": [

to get rid of this error :

Only secure origins are allowed

use these two commands:

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
ipfs config --json Gateway.HTTPHeaders.Access-Control-Allow-Origin '["*"]'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.