mirror of
https://github.com/moepman/acertmgr.git
synced 2024-12-29 09:21:51 +01:00
standalone: cleanup start/stop challenge
stop_challenge should only stop the server if the thread is still alive
This commit is contained in:
parent
e12abbc3cb
commit
762037c42d
@ -67,13 +67,14 @@ class ChallengeHandler(HTTPChallengeHandler):
|
||||
del self.challenges[token]
|
||||
|
||||
def start_challenge(self, domain, thumbprint, token):
|
||||
def _():
|
||||
def _serve():
|
||||
self.server.serve_forever()
|
||||
|
||||
self.server_thread = threading.Thread(target=_)
|
||||
self.server_thread = threading.Thread(target=_serve)
|
||||
self.server_thread.start()
|
||||
HTTPChallengeHandler.start_challenge(self, domain, thumbprint, token)
|
||||
|
||||
def stop_challenge(self, domain, thumbprint, token):
|
||||
if self.server_thread.is_alive():
|
||||
self.server.shutdown()
|
||||
self.server_thread.join()
|
||||
|
Loading…
Reference in New Issue
Block a user