Skip to content

Commit

Permalink
Fixed verification bug and added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlewis committed Nov 17, 2013
1 parent a22d32f commit bba0c7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions django_ses/tests/__init__.py
Expand Up @@ -3,3 +3,4 @@
from .settings import *
from .stats import *
from .views import *
from .test_verifier import *
4 changes: 3 additions & 1 deletion django_ses/utils.py
Expand Up @@ -123,13 +123,15 @@ def _get_cert_url(self):
"""
cert_url = self._data.get('SigningCertURL')
if cert_url:
if not cert_url.startswith('https://'):
if cert_url.startswith('https://'):
url_obj = urlparse(cert_url)
for trusted_domain in settings.BOUNCE_CERT_DOMAINS:
parts = trusted_domain.split('.')
if url_obj.netloc.split('.')[-len(parts):] == parts:
return cert_url
logger.warning('Untrusted certificate URL: "%s"', cert_url)
else:
logger.warning('No signing certificate URL: "%s"', cert_url)
return None

def _get_bytes_to_sign(self):
Expand Down

0 comments on commit bba0c7e

Please sign in to comment.