Skip to content

Commit

Permalink
Fix: try to detect if server is ready without client certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
grydz committed Dec 24, 2024
1 parent 1143c9a commit 93a9bc8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cli/cenclave/src/cenclave/core/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from uuid import UUID

import requests
import urllib3
from pydantic import BaseModel

from cenclave.core.base64 import base64url_encode
Expand Down Expand Up @@ -122,11 +123,15 @@ def is_ready(

if response.status_code != 503 and "Mse-Status" not in response.headers:
return True
except requests.exceptions.Timeout:
return False
except requests.exceptions.SSLError:
except (
requests.exceptions.Timeout,
requests.exceptions.SSLError,
):
return False
except requests.exceptions.ConnectionError:
except requests.exceptions.ConnectionError as exc:
err, *_ = exc.args
if isinstance(err, urllib3.exceptions.ProtocolError):
return True
return False

return False

0 comments on commit 93a9bc8

Please sign in to comment.