UnderIn truffle.js (or truffle-config.js) under the Ropstenropsten provider function, try passing the infuraInfura API endpointURL with "https://" before it. Worked for mehttps://. So it should look like this:
// Inside truffle.js
...
module.exports = {
networks: {
...
ropsten: {
provider: function() {
return new HDWalletProvider(MNEMONIC, "https://ropsten.infura.io/v3/my-key")
},
network_id: 3,
gas: 4000000 //make sure this gas allocation isn't over 4M, which is the max
}
}
};