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

SSLError: [Errno 2] No such file or directory -> Both for webroot and standalone #4481

Closed
George3d6 opened this issue Apr 8, 2017 · 1 comment

Comments

@George3d6
Copy link

My operating system is (include version):

Linux vps395131.ovh.net 4.10.6-1-ARCH #1 SMP PREEMPT Mon Mar 27 08:28:22 CEST 2017 x86_64 GNU/Linux

I installed Certbot with (certbot-auto, OS package manager, pip, etc):

https://www.archlinux.org/packages/?name=certbot

I ran this command and it produced this output:

certbot certonly --standalone --email george.hosu@protonmail.com -d cerebralab.com -d www.cerebralab.com

Certbot's behavior differed from what I expected because:

I'm not quite sure how to interpret the error, it seems to be a problem with one of the python libraries, similar issues are old (2015/2016) and seem to have no real fix associated to them.

Here is a Certbot log showing the issue (if available):

Logs are stored in /var/log/letsencrypt by default. Feel free to redact domains, e-mail and IP addresses as you see fit.

2017-04-08 10:20:03,889:DEBUG:certbot.main:Root logging level set at 20
2017-04-08 10:20:03,889:INFO:certbot.main:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2017-04-08 10:20:03,890:DEBUG:certbot.main:certbot version: 0.12.0
2017-04-08 10:20:03,890:DEBUG:certbot.main:Arguments: ['--standalone', '--email', 'blax@protonmail.com', '-d', 'cerebralab.co
m', '-d', 'www.cerebralab.com']
2017-04-08 10:20:03,891:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#webroot,PluginEntryPoint#null,Plugin
EntryPoint#manual,PluginEntryPoint#standalone)
2017-04-08 10:20:03,891:DEBUG:certbot.plugins.selection:Requested authenticator standalone and installer None
2017-04-08 10:20:04,024:DEBUG:certbot.plugins.selection:Single candidate plugin: * standalone
Description: Spin up a temporary webserver
Interfaces: IAuthenticator, IPlugin
Entry point: standalone = certbot.plugins.standalone:Authenticator
Initialized: <certbot.plugins.standalone.Authenticator object at 0x7f2c77601fd0>
Prep: True
2017-04-08 10:20:04,025:DEBUG:certbot.plugins.selection:Selected authenticator <certbot.plugins.standalone.Authenticator object at 0
x7f2c77601fd0> and installer None
2017-04-08 10:20:04,252:DEBUG:acme.client:Sending GET request to https://acme-v01.api.letsencrypt.org/directory.
2017-04-08 10:20:04,254:DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): acme-v01.api.letsencrypt.o
rg
2017-04-08 10:20:04,277:DEBUG:certbot.main:Exiting abnormally:
Traceback (most recent call last):
File "/usr/bin/certbot", line 11, in
load_entry_point('certbot==0.12.0', 'console_scripts', 'certbot')()
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 896, in main
return config.func(config, plugins)
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 676, in certonly
le_client = _init_le_client(config, auth, installer)
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 392, in _init_le_client
acc, acme = _determine_account(config)
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 377, in _determine_account
config, account_storage, tos_cb=_tos_cb)
File "/usr/lib/python2.7/site-packages/certbot/client.py", line 128, in register
acme = acme_from_config_key(config, key)
File "/usr/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 "/usr/lib/python2.7/site-packages/acme/client.py", line 69, in init
self.net.get(directory).json())
File "/usr/lib/python2.7/site-packages/acme/client.py", line 658, in get
self._send_request('GET', url, **kwargs), content_type=content_type)
File "/usr/lib/python2.7/site-packages/acme/client.py", line 631, in _send_request
response = self.session.request(method, url, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
SSLError: [Errno 2] No such file or directory

@George3d6
Copy link
Author

In my case the problem (apparently) was that the ssl library could not find a "default" certificate bundle.

It was fixed by the first answer in this so question:
http://stackoverflow.com/questions/27726815/requests-exceptions-sslerror-errno-2-no-such-file-or-directory

On my machine the fix was:
export REQUESTS_CA_BUNDLE=/etc/ssl/cert.pem

I'm not sure exactly if the problem was with my version of python or with the place where by certificate was or with the global var not being set or with something else entirely.

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

1 participant