Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable json output #491

Closed
maage opened this issue Feb 5, 2021 · 1 comment
Closed

Stable json output #491

maage opened this issue Feb 5, 2021 · 1 comment
Projects

Comments

@maage
Copy link

maage commented Feb 5, 2021

Is your feature request related to a problem? Please describe.

It seems json output is not stable. If I run it repeatedly, entities change order.

scan_commands
elliptic_curves.rejected_curves order
openssl_name seems to change from DHE to EDH variant.

Obviously ephemeral_key public_bytes,x,y and total_scan_time are going change, but that is not a problem.

Describe the solution you'd like

Run sslyze with some args, wait couple of minutes, run it again with same args as before. Compare json outputs with diff or similar tool. And notice there is only differencies where values changed.

Describe alternatives you've considered

This helps to fix scan_commands:

diff --git a/sslyze/json.py b/sslyze/json.py
index 79cea7b..06244a2 100644
--- a/sslyze/json.py
+++ b/sslyze/json.py
@@ -32,7 +32,7 @@ def _enum_to_json(obj: Enum) -> JsonType:
 
 
 def _set_to_json(obj: set) -> JsonType:
-    return list(obj)
+    return sorted(list(obj))
 
 
 def _path_to_json(obj: Path) -> JsonType:

But elliptic_curves.rejected_curves order seems to be random.

@nabla-c0d3 nabla-c0d3 added this to To do in 4.0.3 Feb 7, 2021
@nabla-c0d3 nabla-c0d3 moved this from To do to Done in 4.0.3 Feb 15, 2021
@nabla-c0d3
Copy link
Owner

Fix released as part of v4.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
4.0.3
Done
Development

No branches or pull requests

2 participants