2

I installed my own ethereum node and put it behind HTTPS nginx proxy. geth attach works perfectly but truffle deploy failed with error:

<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title>
</head>
<body bgcolor=\"white\">
<center><h1>400 Bad Request</h1>
</center>
<center>The plain HTTP request was sent to HTTPS port</center>

<hr><center>nginx/1.10.2</center>
</body>
</html>

I understand why it happens, question is how to force Truffle work over HTTPS, not HTTP?

1

I found workaround for this case, just add provider field to truffle.js:

const Web3 = require('web3');

module.exports = {
  networks: {
    ropsten: {
      .................
      provider: new Web3.providers.HttpProvider('https://host.name:8545')
    },
    rinkeby: {
      ......
      provider: new Web3.providers.HttpProvider('https://host.name:8546')
    }
  }
};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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