Skip to content

Commit 6e1e213

Browse files
committed
Fix crash
1 parent 73f235a commit 6e1e213

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sslyze/plugins/certificate_info/json_output.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ class _OcspResponseAsJson(BaseModelWithOrmMode):
216216
@model_validator(mode="before")
217217
@classmethod
218218
def _handle_object(cls, ocsp_response: ocsp.OCSPResponse) -> Any:
219+
if not isinstance(ocsp_response, ocsp.OCSPResponse):
220+
return ocsp_response
221+
219222
response_status = ocsp_response.response_status.name
220223
if ocsp_response.response_status != ocsp.OCSPResponseStatus.SUCCESSFUL:
221224
return dict(
@@ -228,7 +231,7 @@ def _handle_object(cls, ocsp_response: ocsp.OCSPResponse) -> Any:
228231
serial_number=None,
229232
)
230233
return dict(
231-
response_status=ocsp_response.response_status,
234+
response_status=response_status,
232235
certificate_status=ocsp_response.certificate_status,
233236
revocation_time=ocsp_response.revocation_time_utc,
234237
produced_at=ocsp_response.produced_at_utc,

0 commit comments

Comments
 (0)