Verify third party ID server certificates

This commit is contained in:
Daniel Wagner-Hall 2015-10-16 14:54:54 +01:00
parent 6ffbcf45c6
commit b8dd5b1a2d
4 changed files with 43 additions and 9 deletions

View file

@ -63,7 +63,7 @@ def check_key_valid(http_client, event):
event.content["third_party_invite"]["key_validity_url"],
{"public_key": event.content["third_party_invite"]["public_key"]}
)
if not response["valid"]:
raise AuthError(403, "Third party certificate was invalid")
except IOError:
except Exception:
raise AuthError(502, "Third party certificate could not be checked")
if "valid" not in response or not response["valid"]:
raise AuthError(403, "Third party certificate was invalid")