Raise ValidationError when CSR does not have a subject hostname
Raise ValidationError when CSR does not have a subject hostname. Ticket: https://fedorahosted.org/freeipa/ticket/3123
This commit is contained in:
1 parent
c481e40d78
commit
4d6de44d3d
1 file changed
+4
@@ -296,6 +296,10 @@ class cert_request(VirtualCommand):
|
||||
|
||||
# Ensure that the hostname in the CSR matches the principal
|
||||
subject_host = get_csr_hostname(csr)
|
||||
if not subject_host:
|
||||
raise errors.ValidationError(name='csr',
|
||||
error=_("No hostname was found in subject of request."))
|
||||
|
||||
(servicename, hostname, realm) = split_principal(principal)
|
||||
if subject_host.lower() != hostname.lower():
|
||||
raise errors.ACIError(
|
||||
|
||||
Reference in new issue
Block a user