You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run and observe error on the ServerScanResultAsJson.from_orm(...) method
Example Error
Traceback (most recent call last):
File "C:\Testing\scan.py", line 314, in <module>
main()
File "C:\Testing\scan.py", line 159, in main
list_json_format_scan_results.append(ServerScanResultAsJson.from_orm(server_scan_result))
File "C:\Users\Foo\AppData\Roaming\Python\Python310\site-packages\sslyze\json\json_output.py", line 195, in from_orm
scan_result_as_json = AllScanCommandsAttemptsAsJson.from_orm(server_scan_result.scan_result)
File "C:\Users\Foo\AppData\Roaming\Python\Python310\site-packages\sslyze\json\json_output.py", line 91, in from_orm
all_scan_commands_attempts_json[field_name] = scan_command_attempt_json_cls(
File "C:\Users\Foo\AppData\Roaming\Python\Python310\site-packages\pydantic\main.py", line 406, in __init__
raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for HttpHeadersScanAttemptAsJson
result
asdict() should be called on dataclass instances (type=type_error)
Expected behavior
Scan result parses to JSON successfully, to be written out to a JSON file later.
Python Environment
OS: Windows 10 21H1
Python version: 3.10.0
PIP Package List
From a virtual environment, pip install sslyze results in this package list.
Package
Version
cffi
1.15.0
cryptography
36.0.1
nassl
4.0.2
pip
21.2.3
pycparser
2.21
pydantic
1.8.2
setuptools
57.4.0
sslyze
5.0.2
tls-parser
2.0.0
typing_extensions
4.0.1
Additional context
This seems to be a per site issue, i.e., some sites work and others don't. That said, I can't replicate the error for the same sites when using the command line version. Perhaps this is an issue with one of the scan modules? It's my understanding that the API uses all modules by default vs. the smaller set of modules for the command line version.
The text was updated successfully, but these errors were encountered:
Yup, looks like this might be an issue with the HTTP headers module?
C:\>sslyze.exe --quiet --json_out foo.json --http_headers support.google.com docs.microsoft.com docs.ubuntu.com
Traceback (most recent call last):
File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Foo\AppData\Roaming\Python\Python310\Scripts\sslyze.exe\__main__.py", line 7, in <module>
File "C:\Users\Foo\AppData\Roaming\Python\Python310\site-packages\sslyze\__main__.py", line 76, in main
server_scan_results=[ServerScanResultAsJson.from_orm(result) for result in all_server_scan_results],
File "C:\Users\Foo\AppData\Roaming\Python\Python310\site-packages\sslyze\__main__.py", line 76, in <listcomp>
server_scan_results=[ServerScanResultAsJson.from_orm(result) for result in all_server_scan_results],
File "C:\Users\Foo\AppData\Roaming\Python\Python310\site-packages\sslyze\json\json_output.py", line 195, in from_orm
scan_result_as_json = AllScanCommandsAttemptsAsJson.from_orm(server_scan_result.scan_result)
File "C:\Users\Foo\AppData\Roaming\Python\Python310\site-packages\sslyze\json\json_output.py", line 91, in from_orm
all_scan_commands_attempts_json[field_name] = scan_command_attempt_json_cls(
File "C:\Users\Foo\AppData\Roaming\Python\Python310\site-packages\pydantic\main.py", line 406, in __init__
raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for HttpHeadersScanAttemptAsJson
result
asdict() should be called on dataclass instances (type=type_error)
Describe the Bug
I'm getting a
pydantic.error_wrappers.ValidationError
error message when attempting to save scan results as JSON using the API.Steps to Reproduce
Steps to reproduce the behavior:
pip install sslyze
ServerScanResultAsJson.from_orm(...)
methodExample Error
Expected behavior
Scan result parses to JSON successfully, to be written out to a JSON file later.
Python Environment
Windows 10 21H1
3.10.0
PIP Package List
From a virtual environment,
pip install sslyze
results in this package list.Additional context
This seems to be a per site issue, i.e., some sites work and others don't. That said, I can't replicate the error for the same sites when using the command line version. Perhaps this is an issue with one of the scan modules? It's my understanding that the API uses all modules by default vs. the smaller set of modules for the command line version.
The text was updated successfully, but these errors were encountered: