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

Handle case for when object to serialize is of bytes type, fixes #380 #383

Conversation

RaheelaKhan1172
Copy link
Contributor

@RaheelaKhan1172 RaheelaKhan1172 commented Jun 27, 2019

This fixes the bug in #380. The issue was a bytes object not being handled in _CustomJsonEncoder. You can also fix this here:

raise StartTlsError(self.ERR_NO_STARTTLS)

by explicitly passing a string by decoding self.ERR_NO_STARTTLS. I'm not sure which method you'd prefer.
I can add a test too if it's helpful - let me know what you think!

I forgot to post the command I used to reproduce the bug:
sslyze/__main__.py --tlsv1_2 --json_out=- --starttls=imap imap-mail.outlook.com:110

and the result I get after the update:

{
    "accepted_targets": [],
    "invalid_targets": [
        {
            "imap-mail.outlook.com:110": "IMAP START TLS was rejected"
        }
    ],
    "sslyze_url": "https://github.com/nabla-c0d3/sslyze",
    "sslyze_version": "2.1.3",
    "total_scan_time": "0.06627202033996582"
}

@nabla-c0d3
Copy link
Owner

I ended up fixing it the other way ( e97f20f ). Thanks for looking into it!

@nabla-c0d3 nabla-c0d3 closed this Jul 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants