nabla-c0d3 / nassl

Experimental OpenSSL wrapper for Python 3.8+ and SSLyze.
GNU Affero General Public License v3.0
39 stars 35 forks source link

UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 4279: invalid continuation byte #24

Closed raulsiles closed 6 years ago

raulsiles commented 6 years ago

When running the "pshtt" tool, as it uses "sslyze" and, therefore, "nassl", when the "ocsp_response.py" tool (or plugin) is executed, the following error is generated, due to an unexpected, or badly encoded, character in the OCSP response:

  File "/home/<user>/.local/lib/python2.7/site-packages/nassl/ocsp_response.py", line 60, in as_dict
    response_text = self.as_text()
  File "/home/<user>/.local/lib/python2.7/site-packages/nassl/ocsp_response.py", line 30, in as_text
    return self._ocsp_response.as_text()
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 4279: invalid continuation byte

I originally saw this error with nassl version 0.16.3 (in Kali Linux), but I can also reproduce it with the latest nassl version, 1.0.2.

I can submit privately the target hostname that generates this error in case you are interested in adding code to manage "strange" characters or other encoding formats.

nabla-c0d3 commented 6 years ago

Thanks - can you email me the hostname? It would help a lot.