sslyze icon indicating copy to clipboard operation
sslyze copied to clipboard

Export ServerScanResult to json via python API.

Open r4t31 opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. Is there any way to easily export the python ServerScanResult object to json?

Describe the solution you'd like Some function for ServerScanResult object like ServerScanResult.to_json("./path_to_output.json")

Describe alternatives you've considered Probably possible to use some json serializer for this purpose.

r4t31 avatar Jun 11 '22 10:06 r4t31

Hello, Yes, it is visible here for example: https://github.com/nabla-c0d3/sslyze/blob/8bf376c06af5fad9a78850c60013fd3d90022c3b/sslyze/main.py#L77

result_as_json = ServerScanResultAsJson.from_orm(result)
result_as_json_str =  result_as_json.json()  # <- String containing the JSON result

nabla-c0d3 avatar Jun 11 '22 17:06 nabla-c0d3

I added documentation on how to do this as part of v5.0.6.

nabla-c0d3 avatar Oct 15 '22 11:10 nabla-c0d3