forked from mtusi2026/mtusi2026lab7
13 lines
506 B
Python
13 lines
506 B
Python
#!/usr/bin/env python3
|
|
import ssl,time,urllib.request,os
|
|
from pathlib import Path
|
|
root=Path(__file__).resolve().parents[1]
|
|
ctx=ssl.create_default_context(cafile=str(root/'secrets/lab7/lb/ca.crt'))
|
|
for _ in range(90):
|
|
try:
|
|
with urllib.request.urlopen(os.environ.get('LAB7_BASE_URL','https://localhost:8443')+'/health/ready',context=ctx,timeout=2) as r:
|
|
if r.status==200:print('PASS: verified HTTPS readiness');break
|
|
except OSError:pass
|
|
time.sleep(1)
|
|
else:raise SystemExit('HTTPS readiness timeout')
|