Why time.strptime does not to convert date

I have this code that checks certificate expiration date.

import ssl
import OpenSSL
import time
def get_SSL_Expiry_Date(host, port):
cert = ssl.get_server_certificate((host, 443))
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert)
raw_date = x509.get_notAfter()
print (raw_date)
dexpires = time.strptime(raw_date, "b'%Y%m%d%H%M%Sz")
# print (dexpires)
get_SSL_Expiry_Date("google.com", 443)

The code works when this line is commented:

dexpires = time.strptime(raw_date, "b'%Y%m%d%H%M%Sz")

I get this error:

IndentationError: unindent does not match any outer indentation level.

What am I doing wrong?