So I can't seem to create a certificate. I installed a server a month ago to try… it out, and then it worked perfectly. Now, it doesn't.
I'm running nextcloud 11.0.0snap3 on Unbuntu Server 16.10.
This is what I get:
```
~> sudo nextcloud.enable-https -d
In order for Let's Encrypt to verify that you actually own the domain for
which you're requesting a certificate, there are a number of requirements
of which you need to be aware:
1. In order to register with the Let's Encrypt ACME server, you must agree
to the currently-in-effect Subscriber Agreement located here:
https://letsencrypt.org/repository/
By continuing to use this tool you agree to these terms. Please cancel
now if otherwise.
2. You must have the domain name(s) for which you want certificates
pointing at the external IP address of this machine.
3. Both ports 80 and 443 on the external IP address of this machine must
point to this machine (e.g. port forwarding might need to be setup on
your router).
Have you met these requirements? (y/n) y
Please enter an email address (for urgent notices or key recovery): me@example.com
Please enter your domain name(s) (space-separated): example.com
Attempting to obtain certificates... error running certbot:
Saving debug log to /var/snap/nextcloud/current/certs/certbot/logs/letsencrypt.log
An unexpected error occurred:
ConnectionError: HTTPSConnectionPool(host='acme-staging.api.letsencrypt.org', port=443): Max retries exceeded with url: /directory (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f81b8bd6910>: Failed to establish a new connection: [Errno -2] Name or service not known',))
Please see the logfiles in /var/snap/nextcloud/current/certs/certbot/logs for more details.
```
(i obviously didn't use example.com when I ran it)
This is what the log says:
```
2017-01-17 14:39:50,777:DEBUG:certbot.main:Root logging level set at 20
2017-01-17 14:39:50,780:INFO:certbot.main:Saving debug log to /var/snap/nextcloud/current/certs/certbot/logs/letsencrypt.log
2017-01-17 14:39:50,781:DEBUG:certbot.main:certbot version: 0.9.3
2017-01-17 14:39:50,781:DEBUG:certbot.main:Arguments: ['--text', '--config-dir', '/var/snap/nextcloud/current/certs/certbot/config', '--work-dir', '/var/snap/nextcloud/current/certs/certbot/work', '--logs-dir', '/var/snap/nextcloud/current/certs/certbot/logs', '--dry-run', '--authenticator', 'nextcloud:webroot', '--nextcloud:webroot-path', '/var/snap/nextcloud/current/certs/certbot', '--rsa-key-size', '4096', '--email', 'me@example.com', '--non-interactive', '--agree-tos', '--force-renewal', '-d', 'example.com']
2017-01-17 14:39:50,783:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#webroot,PluginEntryPoint#null,PluginEntryPoint#manual,PluginEntryPoint#standalone,PluginEntryPoint#nextcloud:webroot)
2017-01-17 14:39:50,784:DEBUG:certbot.plugins.selection:Requested authenticator nextcloud:webroot and installer None
2017-01-17 14:39:50,795:DEBUG:certbot.plugins.selection:Single candidate plugin: * nextcloud:webroot
Description: Place files in webroot directory without running chown
Interfaces: IAuthenticator, IPlugin
Entry point: webroot = certbot_nextcloud_plugin.webroot:Authenticator
Initialized: <certbot_nextcloud_plugin.webroot.Authenticator object at 0x7f81b8bdda90>
Prep: True
2017-01-17 14:39:50,797:DEBUG:certbot.plugins.selection:Selected authenticator <certbot_nextcloud_plugin.webroot.Authenticator object at 0x7f81b8bdda90> and installer None
2017-01-17 14:39:54,419:DEBUG:root:Sending GET request to https://acme-staging.api.letsencrypt.org/directory. args: (), kwargs: {}
2017-01-17 14:39:54,580:DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): acme-staging.api.letsencrypt.org
2017-01-17 14:39:54,585:DEBUG:certbot.main:Exiting abnormally:
Traceback (most recent call last):
File "/snap/nextcloud/559/bin/certbot", line 11, in <module>
sys.exit(main())
File "/snap/nextcloud/559/lib/python2.7/site-packages/certbot/main.py", line 776, in main
return config.func(config, plugins)
File "/snap/nextcloud/559/lib/python2.7/site-packages/certbot/main.py", line 558, in obtain_cert
le_client = _init_le_client(config, auth, installer)
File "/snap/nextcloud/559/lib/python2.7/site-packages/certbot/main.py", line 368, in _init_le_client
acc, acme = _determine_account(config)
File "/snap/nextcloud/559/lib/python2.7/site-packages/certbot/main.py", line 353, in _determine_account
config, account_storage, tos_cb=_tos_cb)
File "/snap/nextcloud/559/lib/python2.7/site-packages/certbot/client.py", line 118, in register
acme = acme_from_config_key(config, key)
File "/snap/nextcloud/559/lib/python2.7/site-packages/certbot/client.py", line 42, in acme_from_config_key
return acme_client.Client(config.server, key=key, net=net)
File "/snap/nextcloud/559/lib/python2.7/site-packages/acme/client.py", line 63, in __init__
self.net.get(directory).json())
File "/snap/nextcloud/559/lib/python2.7/site-packages/acme/client.py", line 624, in get
self._send_request('GET', url, **kwargs), content_type=content_type)
File "/snap/nextcloud/559/lib/python2.7/site-packages/acme/client.py", line 606, in _send_request
response = self.session.request(method, url, *args, **kwargs)
File "/snap/nextcloud/559/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/snap/nextcloud/559/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/snap/nextcloud/559/lib/python2.7/site-packages/requests/adapters.py", line 487, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='acme-staging.api.letsencrypt.org', port=443): Max retries exceeded with url: /directory (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f81b8bd6910>: Failed to establish a new connection: [Errno -2] Name or service not known',))
```
I couldn't find an issue on it, but feel free to yell at me if I'm a dummy and missed it.