Econnrefused 127.0.0.1:443

Hi there.

I’m trying to deploy to Rinkeby using Infura (using Etherlime), but am getting a strange error:

'Error: connect ECONNREFUSED 127.0.0.1:443\n' +
    '    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)'

Prior I was getting a different error, but after shutting down a local web server I started getting this one. It would seem to me that something in Infura is trying to listen on port 443, and that the issues stem from that, but I’m not at all certain that I’m diagnosing right. We’ve tried this on Linux, Mac, and Windows, and are all getting the same error (though triggered by different lines in net.js it seems).

Any thoughts about what we can do to fix this?

Hi @wschwab - welcome to the Infura community!

From that error message it looks like one of a few things could be happening:

  • you haven’t started the server
  • something (maybe a firewall?) is blocking the connection to the server
  • you meant to connect to a server running on a different host or port

Give these a try and let us know if that worked or not!

Thank you for the kind answer, @Leiya_Kenney . Those three suggestions ended up not being the root cause, but we have been able to identify what went wrong. For context, this a snippet from the deployment script (/deployment/deploy.js) in Etherlime:

} else if (network == 'rinkeby') {
		// Overriding default config for rinkeby test net
		defaultConfigs.chainId = 4;
		// Setting private key for this network
		secret = process.env.DEPLOYER_PRIVATE_KEY_RINKEBY;
		// Setting the RPC
		RPC = `https:/rinkeby.infura.io/v3/${process.env.INFURA_API_KEY_RINKEBY}`;

       deployer = new etherlime.JSONRPCPrivateKeyDeployer(
		   	secret, 
			RPC, 
			defaultConfigs
		);


		console.log("Deploying to Rinkeby network");
	}

When using Infura, though, the deployer needs to be configured differently, using Etherlime’s InfuraPrivateKeyDeployer instead of the JSONRPCPrivateKeyDeployer:

} else if (network == 'rinkeby') {
		// Overriding default config for rinkeby test net
		defaultConfigs.chainId = 4;
		// Setting private key for this network
		secret = process.env.DEPLOYER_PRIVATE_KEY_RINKEBY;
		// Setting the RPC
		// RPC = 'https://rinkeby.infura.io'
		RPC = `https:/rinkeby.infura.io/v3/${process.env.INFURA_API_KEY_RINKEBY}`;

		deployer = new etherlime.InfuraPrivateKeyDeployer(
			secret, 
			network, 
			process.env.INFURA_API_KEY_RINKEBY, 
			defaultConfigs
		);

		console.log("Deploying to Rinkeby network");
	}

Now everything seems to be working fine.

Glad to hear it’s working - thanks for posting your solution!