summaryrefslogtreecommitdiffstats
path: root/base/ca
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-08-05 19:10:19 +0200
committerEndi S. Dewata <edewata@redhat.com>2015-08-05 21:14:24 +0200
commitfec55e3cfa8c0917ef63f3d6289fe3788f80bf33 (patch)
treec937cced832af56e63e710f2572efadcf3e7f47a /base/ca
parent6999197b067af920b53c75e17dc20181ba49e997 (diff)
downloadpki-fec55e3cfa8c0917ef63f3d6289fe3788f80bf33.tar.gz
pki-fec55e3cfa8c0917ef63f3d6289fe3788f80bf33.tar.xz
pki-fec55e3cfa8c0917ef63f3d6289fe3788f80bf33.zip
Fixed missing cert request hostname and address.
The CA services have been modified to inject request hostname and address into the certificate request object such that they will be stored in the database. This fixes the problem with requests submitted either via the UI or the CLI. An unused method in CertRequestResource has been removed. Some debug messages have been cleaned as well. https://fedorahosted.org/pki/ticket/1535
Diffstat (limited to 'base/ca')
-rw-r--r--base/ca/src/org/dogtagpki/server/ca/rest/CertRequestService.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/base/ca/src/org/dogtagpki/server/ca/rest/CertRequestService.java b/base/ca/src/org/dogtagpki/server/ca/rest/CertRequestService.java
index a11cb470b..95f1f4c20 100644
--- a/base/ca/src/org/dogtagpki/server/ca/rest/CertRequestService.java
+++ b/base/ca/src/org/dogtagpki/server/ca/rest/CertRequestService.java
@@ -27,7 +27,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
@@ -113,13 +112,6 @@ public class CertRequestService extends PKIService implements CertRequestResourc
return createOKResponse(info);
}
- // Enrollment - used to test integration with a browser
- @Override
- public Response enrollCert(MultivaluedMap<String, String> form) {
- CertEnrollmentRequest data = new CertEnrollmentRequest(form);
- return enrollCert(data);
- }
-
@Override
public Response enrollCert(CertEnrollmentRequest data) {
@@ -128,6 +120,9 @@ public class CertRequestService extends PKIService implements CertRequestResourc
throw new BadRequestException("Unable to create enrollment reequest: Invalid input data");
}
+ data.setRemoteHost(servletRequest.getRemoteHost());
+ data.setRemoteAddr(servletRequest.getRemoteAddr());
+
CertRequestDAO dao = new CertRequestDAO();
CertRequestInfos infos;
@@ -143,10 +138,10 @@ public class CertRequestService extends PKIService implements CertRequestResourc
CMS.debug("enrollCert: bad request data: " + e);
throw new BadRequestException(e.toString());
} catch (EBaseException e) {
- throw new PKIException(e.toString());
+ throw new PKIException(e);
} catch (Exception e) {
CMS.debug(e);
- throw new PKIException(e.toString());
+ throw new PKIException(e);
}
// this will return an error code of 200, instead of 201