main: Convert some certinfo fields to native strings.
This commit is contained in:
parent
096372030d
commit
bb510e453a
1 changed files with 4 additions and 3 deletions
7
main.py
7
main.py
|
@ -92,7 +92,8 @@ def print_certificate_info(buff, sock, cert):
|
||||||
|
|
||||||
key_info = ("key info: {key_type} key {bits} bits, signed using "
|
key_info = ("key info: {key_type} key {bits} bits, signed using "
|
||||||
"{algo}").format(
|
"{algo}").format(
|
||||||
key_type=key_type, bits=key_size, algo=signature_algorithm)
|
key_type=key_type, bits=key_size,
|
||||||
|
algo=n(signature_algorithm))
|
||||||
|
|
||||||
validity_info = (" Begins on: {before}\n"
|
validity_info = (" Begins on: {before}\n"
|
||||||
" Expires on: {after}").format(
|
" Expires on: {after}").format(
|
||||||
|
@ -110,8 +111,8 @@ def print_certificate_info(buff, sock, cert):
|
||||||
issuer = "issuer: {issuer}".format(issuer=issuer)
|
issuer = "issuer: {issuer}".format(issuer=issuer)
|
||||||
|
|
||||||
fingerprints = (" SHA1: {}\n"
|
fingerprints = (" SHA1: {}\n"
|
||||||
" SHA256: {}").format(sha1_fingerprint,
|
" SHA256: {}").format(n(sha1_fingerprint),
|
||||||
sha256_fingerprint)
|
n(sha256_fingerprint))
|
||||||
|
|
||||||
wrapper = textwrap.TextWrapper(
|
wrapper = textwrap.TextWrapper(
|
||||||
initial_indent=" - ", subsequent_indent=" ")
|
initial_indent=" - ", subsequent_indent=" ")
|
||||||
|
|
Loading…
Add table
Reference in a new issue