Failed to connect to https for letsencrypt verification

When run

sudo bench setup lets-encrypt erp.texol.it

return a failed

Failed authorization procedure. erp.xxxxx.it (tls-sni-01): urn:acme:error:connection :: The server c ould not connect to the client to verify the domain :: Failed to connect to xx.xx.xx.xx:443 for tls- sni-01 challenge

DNS with provider work, NAT work

Erpnext listen default only on port *:80, and this work with nat from my 3g phone

for execute lets encrypt setup, i do first ssl nginx?

ERPNext: v8.0.33 (master)
Frappe Framework: v8.0.55 (master)

Running this will stop the nginx service temporarily causing your sites to go offline
Do you want to continue? [y/N]: y
INFO:bench.utils:sudo systemctl stop nginx
INFO:bench.utils:/opt/certbot-auto --config /etc/letsencrypt/configs/erp.xxxxx.it.cfg certonly
WARNING: The standalone specific supported challenges flag is deprecated.
Please use the --preferred-challenges flag instead.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for erp.xxxxx.it
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. erp.xxxxx.it (tls-sni-01): urn:acme:error:connection :: The server c                                     ould not connect to the client to verify the domain :: Failed to connect to xx.xx.xx.xx:443 for tls-                                     sni-01 challenge

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: erp.xxxxx.it
   Type:   connection
   Detail: Failed to connect to xx.xx.xx.xx:443 for tls-sni-01
   challenge

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A record(s) for that domain
   contain(s) the right IP address. Additionally, please check that
   your computer has a publicly routable IP address and that no
   firewalls are preventing the server from communicating with the
   client. If you're using the webroot plugin, you should also verify
   that you are serving files from the webroot path you provided.
INFO:bench.utils:sudo systemctl start nginx
There was a problem trying to setup SSL for your site
Traceback (most recent call last):
  File "/usr/bin/bench", line 9, in <module>
    load_entry_point('bench==4.1.0', 'console_scripts', 'bench')()
  File "/home/frappe/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/bench-repo/bench/commands/setup.py", line 104, in setup_letsencrypt
    setup_letsencrypt(site, custom_domain, bench_path='.')
  File "/home/frappe/bench-repo/bench/config/lets_encrypt.py", line 42, in setup_letsencrypt
    setup_crontab()
  File "/home/frappe/bench-repo/bench/config/lets_encrypt.py", line 89, in setup_crontab
    user_crontab.write()
  File "/usr/lib/python2.7/site-packages/crontab.py", line 311, in write
    raise IOError("Please specify user or filename to write.")
IOError: Please specify user or filename to write.

Can you test this pull request?

https://github.com/frappe/bench/pull/407