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

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


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


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.