Skip to content

Commit

Permalink
Fix: modules.x509.verify_crl: Python 3 needs bytes
Browse files Browse the repository at this point in the history
TypeError: a bytes-like object is required, not 'str'
  • Loading branch information
alxwr committed Feb 24, 2020
1 parent 3e61250 commit 68fdf8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions salt/modules/x509.py
Original file line number Diff line number Diff line change
Expand Up @@ -1785,13 +1785,13 @@ def verify_crl(crl, cert):
crltext = _text_or_file(crl)
crltext = get_pem_entry(crltext, pem_type='X509 CRL')
crltempfile = tempfile.NamedTemporaryFile()
crltempfile.write(salt.utils.stringutils.to_str(crltext))
crltempfile.write(salt.utils.stringutils.to_bytes(crltext, encoding='ascii'))
crltempfile.flush()

certtext = _text_or_file(cert)
certtext = get_pem_entry(certtext, pem_type='CERTIFICATE')
certtempfile = tempfile.NamedTemporaryFile()
certtempfile.write(salt.utils.stringutils.to_str(certtext))
certtempfile.write(salt.utils.stringutils.to_bytes(certtext, encoding='ascii'))
certtempfile.flush()

cmd = ('openssl crl -noout -in {0} -CAfile {1}'.format(
Expand Down

0 comments on commit 68fdf8d

Please sign in to comment.