summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipalib/plugins/cert.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py
index c4bbf8215..3aa01621d 100644
--- a/ipalib/plugins/cert.py
+++ b/ipalib/plugins/cert.py
@@ -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(