I recently updated my python/conda to 3.11. Included is a new version of OpenSSL. The below code has worked for some time on version 1.1.1, but now with version 3.0.1, the kid line is giving an error. Is there a new syntax, or another argument that needs to be passed?
from OpenSSL import crypto
headers = {'alg': 'RS256',
# this is the line that throws the error
'kid': crypto.X509().digest('sha1').decode('utf-8').replace(':', ''),
'typ': 'JWT',
}
Please let me know if more code is needed
Commented out the 'kid' line and the jwt is still accepted by the receiving end and produces the necessary token. I also had to update my pyjwt package to 2.8.0 from 2.4.0.