Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECONNRESET Error when making calls. (Using SSL) #16

Open
haydencarlson opened this issue Oct 4, 2018 · 5 comments
Open

ECONNRESET Error when making calls. (Using SSL) #16

haydencarlson opened this issue Oct 4, 2018 · 5 comments

Comments

@haydencarlson
Copy link

haydencarlson commented Oct 4, 2018

Here is my VERGE.conf

server=1
rpcuser=
rpcpassword=
rpcport=20102
rpcssl=1
rpcsslcertificatechainfile=verged.crt
rpcsslprivatekeyfile=verged.pem
rpcallowip=0.0.0.0/0

I've tried some wildcard certs I had laying around but also tried

  openssl genrsa -out server.pem 2048
  openssl req -new -x509 -nodes -sha1 -days 3650 -key verged.pem > verged.cert

Whenever I try to make a call it returns ECONNRESET. I can't see anything in the VERGEd log.
Also if I try to use it without SSL it returns 403 forbidden error everytime.

var fs = require('fs')

var ca = fs.readFileSync('verged.crt')

var verge = require('node-verge')({
  user: 'rpcusername',
  pass: 'rpcpassword',
  https: true,
  ca: ca
})

I'm using the library just like the docs say here, reading the .crt file creating from before.

VERGEd is running on a ubuntu 16.04 machine, and I'm trying to connect remotely with node-verge.

@marpme
Copy link
Member

marpme commented Oct 4, 2018

Thanks for your submission, I just tried everything exactly like you did but running the node remotely. (my system: MacOS Mojave)

script:

var fs = require('fs');

var ca = fs.readFileSync('./verged.cert');

var verge = require('node-verge')({
  user: 'kyon',
  pass: 'lolcat',
  https: true,
  ca: ca,
}).send('getinfo', info => {
  console.log(info);
});

Config:

server=1
rpcuser=kyon
rpcpassword=lolcat
rpcport=20102
rpcssl=1
rpcsslcertificatechainfile=verged.cert
rpcsslprivatekeyfile=verged.pem
rpcallowip=0.0.0.0/0
gen=0
printtoconsole=1

And receiving: Error: self-signed certificate, because it's true but I can actually connect to it.
So it has something to do with your remote access. Please make sure that no firewall or something else is blocking it. Maybe try to run this exact same setup on your local machine.

@haydencarlson
Copy link
Author

I have it working now without an SSL on the same server as the node. (No remote connection)

I'm not sure why it wasn't working remotely, because the port was open and I could hit the node without the ssl but it would just get a forbidden error.

@marpme
Copy link
Member

marpme commented Oct 5, 2018

Maybe your way to "allow" IP's is wrong there? I check an example config and there it is noted like this:

# By default, only RPC connections from localhost are allowed.  Specify
# as many rpcallowip= settings as you like to allow connections from
# other hosts (and you may use * as a wildcard character):
rpcallowip=10.1.1.34
rpcallowip=192.168.1.*

https://github.com/vergecurrency/VERGE/blob/8f22bd819d723e7f71eb5a43a50782b3b96e2dd8/contrib/debian/examples/VERGE.conf#L40

@marpme
Copy link
Member

marpme commented Oct 7, 2018

Please give us a short feedback, if everything is working for you so we can mark it as resolved. Thank you 👍

@haydencarlson
Copy link
Author

I changed rpcallowip to how you said and still nothing remotely.
I'm using it locally to the node so it's not a big issue.
If I do get it to connect remotely to the node I will let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants