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

Exception in acme.get_certificate() causes package to crash without cleanup #50

Open
nsmcan opened this issue Oct 12, 2019 · 0 comments

Comments

@nsmcan
Copy link

nsmcan commented Oct 12, 2019

It works fine since January 2019. Recently got an SSL exception in acme.get_certificate(). As a result, script crashed and didn't remove temporary nginx site config 0-letsencrypt.conf. Website functionality was affected.

P.S. I have updated your package to work in Windows, will submit pull request soon...

2019-10-08 01:00:09,103 - INFO - writing challenge file into C:/Tools/nginx/conf/sites-enabled/0-letsencrypt.conf
2019-10-08 01:00:09,103 - INFO - asking acme server to verify challenge
Traceback (most recent call last):
  File "c:\tools\python36-32\lib\urllib\request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "c:\tools\python36-32\lib\http\client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "c:\tools\python36-32\lib\http\client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "c:\tools\python36-32\lib\http\client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "c:\tools\python36-32\lib\http\client.py", line 1026, in _send_output
    self.send(msg)
  File "c:\tools\python36-32\lib\http\client.py", line 964, in send
    self.connect()
  File "c:\tools\python36-32\lib\http\client.py", line 1400, in connect
    server_hostname=server_hostname)
  File "c:\tools\python36-32\lib\ssl.py", line 407, in wrap_socket
    _context=self, _session=session)
  File "c:\tools\python36-32\lib\ssl.py", line 817, in __init__
    self.do_handshake()
  File "c:\tools\python36-32\lib\ssl.py", line 1077, in do_handshake
    self._sslobj.do_handshake()
  File "c:\tools\python36-32\lib\ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:852)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\tools\python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\tools\python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Tools\Python36-32\Scripts\acme-nginx.exe\__main__.py", line 9, in <module>
  File "c:\tools\python36-32\lib\site-packages\acme_nginx\client.py", line 121, in main
    acme.get_certificate()
  File "c:\tools\python36-32\lib\site-packages\acme_nginx\AcmeV2.py", line 194, in get_certificate
    self.solve_http_challenge(directory)
  File "c:\tools\python36-32\lib\site-packages\acme_nginx\AcmeV2.py", line 114, in solve_http_challenge
    code, result, _ = self._send_signed_request(url=challenge['url'], directory=directory)
  File "c:\tools\python36-32\lib\site-packages\acme_nginx\Acme.py", line 248, in _send_signed_request
    headers=request_headers)
  File "c:\tools\python36-32\lib\urllib\request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "c:\tools\python36-32\lib\urllib\request.py", line 526, in open
    response = self._open(req, data)
  File "c:\tools\python36-32\lib\urllib\request.py", line 544, in _open
    '_open', req)
  File "c:\tools\python36-32\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "c:\tools\python36-32\lib\urllib\request.py", line 1361, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "c:\tools\python36-32\lib\urllib\request.py", line 1320, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:852)>
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