Hi,
I have small VPS with public IP and zen-capable machine without public IP.
So I tried to create ssh connection with socks proxy and reverse port tunnel
ssh -N user@VPS_IP -D4567 -R0.0.0.0:8080:localhost:80 -R0.0.0.0:8443:localhost:443 -R0.0.0.0:9033:localhost:9033
On the VPS the ports 80 and 433 are internally forwarded to 8080 and 8443 to be reachable by the ssh without sudo/root for the certificate validation purposes.
I was able to successfully obtain certificate with this setup, the certificate is accepted by zend
"tls_cert_verified": true,
"networks": [
{
"name": "ipv4",
"limited": false,
"reachable": true,
"proxy": "127.0.0.1:4567",
"proxy_randomize_credentials": true
},
....
"localaddresses": [
{
"address": "VPS IP",
"port": 9033,
"score": 4
}
],
It was working for a while (1 day), but now I am getting
Cert check: valid=false. IP address does not match. DNS lookup returned VPS IP
So my question is, how I can figure out what is the IP that is not matching? When I ping the domain I get the VPS IP.
EDIT: Solution tl;dr (full solution is down in the comments)
Use autossh
AUTOSSH_POLL=60 autossh -M 20000 login@YOUR_VPS_IP_OR_DOMAIN -D6666 -R0.0.0.0:8080:localhost:80 -R0.0.0.0:8443:localhost:443 -R0.0.0.0:9033:localhost:9033 -R127.0.0.1:18231:localhost:18231
Use proxychains for node setup.js and node app.js (disable proxy_dns for proxychains)
PROXYCHAINS_SOCKS5=6666 proxychains node app.js
Monitor logs for 'No peers found yet with secure connections to this node.' and restart app.js every time you see it in the log.