Skip to content

Commit 611b1e3

Browse files
committed
fix: remove checks related to ocsp
1 parent 0d5f5fe commit 611b1e3

2 files changed

Lines changed: 0 additions & 68 deletions

File tree

ready/checks/ssl.py

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -216,67 +216,3 @@ def check_dns_caa_record_should_include_validationmethods(responses, **kwargs):
216216
warn_on_fail=True,
217217
**kwargs,
218218
)
219-
220-
221-
# Check: SSL certificate must provide OCSP URI
222-
def check_ssl_certificate_must_include_ocsp_uri(responses, **kwargs):
223-
certificate = get_ssl_certificate(kwargs["domain"], ipv6=kwargs["is_ipv6"])
224-
if not certificate:
225-
ocsp = None
226-
else:
227-
ocsp = certificate.get("OCSP", None)
228-
229-
return result(
230-
ocsp and all([("https://" in r or "http://" in r) for r in ocsp]),
231-
f"SSL certificate must provide OCSP URI ({ocsp})",
232-
"ssl_provide_ocsp_uri",
233-
**kwargs,
234-
)
235-
236-
237-
# Check: SSL certificate should provide OCSP must-staple
238-
def check_ssl_certificate_should_provide_ocsp_must_staple(responses, **kwargs):
239-
try:
240-
from cryptography import x509
241-
except ImportError:
242-
return result(
243-
False,
244-
f"SSL certificate should provide OCSP must-staple (cryptography not installed)",
245-
"ssl_ocsp_must_staple",
246-
warn_on_fail=True,
247-
**kwargs,
248-
)
249-
250-
certificate = get_ssl_certificate(kwargs["domain"], ipv6=kwargs["is_ipv6"], binary=True)
251-
if not certificate:
252-
return result(
253-
False,
254-
f"SSL certificate should provide OCSP must-staple (failed to load certificate)",
255-
"ssl_ocsp_must_staple",
256-
**kwargs,
257-
)
258-
259-
loaded = x509.load_der_x509_certificate(certificate)
260-
261-
has_must_staple_extension = False
262-
msg = "missing extension"
263-
264-
lifetime_days = (loaded.not_valid_after - loaded.not_valid_before).days
265-
if lifetime_days < 10:
266-
has_must_staple_exension = True
267-
msg = "certificate is short-lived; missing extension"
268-
269-
else:
270-
for extension in loaded.extensions:
271-
# see https://github.com/sesh/ready/issues/15 for details
272-
if extension.oid.dotted_string == "1.3.6.1.5.5.7.1.24":
273-
has_must_staple_extension = True
274-
msg = "includes extension"
275-
276-
return result(
277-
has_must_staple_extension,
278-
f"Long-lived SSL certificate should provide OCSP must-staple ({msg})",
279-
"ssl_ocsp_must_staple",
280-
warn_on_fail=True,
281-
**kwargs,
282-
)

ready/ready.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@
9191
check_ssl_connection_fails_with_tls_1_1,
9292
check_ssl_expiry_should_be_greater_than_five_days,
9393
check_ssl_expiry_should_be_less_than_one_year,
94-
check_ssl_certificate_must_include_ocsp_uri,
95-
check_ssl_certificate_should_provide_ocsp_must_staple,
9694
)
9795
from ready.checks.status import check_http_response_should_be_200
9896
from ready.checks.swagger import check_swagger_should_not_return_200
@@ -303,8 +301,6 @@ def ready(
303301
check_ssl_certificate_should_be_trusted,
304302
check_ssl_connection_fails_with_tls_1_1,
305303
check_ssl_connection_fails_with_tls_1_0,
306-
check_ssl_certificate_must_include_ocsp_uri,
307-
check_ssl_certificate_should_provide_ocsp_must_staple,
308304
check_dns_caa_record_should_exist,
309305
check_dns_caa_record_should_include_accounturi,
310306
check_dns_caa_record_should_include_validationmethods,

0 commit comments

Comments
 (0)