Skip to content

Commit

Permalink
Fix for an issue where a call to the Requests.post never returned bec…
Browse files Browse the repository at this point in the history
…ause of a bug in the cryptography module.

ref pyca/cryptography/#2299
  • Loading branch information
jobec committed Feb 11, 2016
1 parent d2ff78e commit 28936fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django_auth_adfs/backend.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from os.path import isfile

import jwt
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.backends.openssl.backend import backend
from cryptography.x509 import load_pem_x509_certificate
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
Expand All @@ -25,7 +25,8 @@ def __init__(self):
certificate = file.read()
if isinstance(certificate, str):
certificate = certificate.encode()
cert_obj = load_pem_x509_certificate(certificate, default_backend())
backend.activate_builtin_random()
cert_obj = load_pem_x509_certificate(certificate, backend)
self._public_key = cert_obj.public_key()
else:
raise ImproperlyConfigured("ADFS token signing certificate not set")
Expand Down

1 comment on commit 28936fb

@jobec
Copy link
Collaborator Author

@jobec jobec commented on 28936fb Feb 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for bypssing the issue mentioned here: pyca/cryptography#2299
I mistyped in the commit message, so I'm redoing the linking here.

Please sign in to comment.