Skip to content
Snippets Groups Projects
Commit 115aa217 authored by Larbi Gharib's avatar Larbi Gharib
Browse files

Desactivate OCSP endpoint

Change-Id: I33c9cae0f82e7c222e4489319aab65238af26caa
parent 106f2b97
No related branches found
No related tags found
No related merge requests found
......@@ -50,22 +50,23 @@ public class OCSPServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("application/ocsp-response");
byte[] content = new byte[Integer.parseInt(req.getHeader("Content-Length"))];
try {
for(int i=0;i<content.length;i++)
req.getInputStream().read(content);
OCSPReq ocspReq = new OCSPReq(content);
OCSPResp response = JamsCA.getOCSPResponse(ocspReq);
if (response != null) {
byte[] respBytes = response.getEncoded();
resp.getOutputStream().write(respBytes);
} else resp.setStatus(404);
}
catch (Exception e) {
resp.sendError(404, "Could not find the requested certificate!");
}
resp.sendError(404);
// resp.setContentType("application/ocsp-response");
// byte[] content = new byte[Integer.parseInt(req.getHeader("Content-Length"))];
// try {
// for(int i=0;i<content.length;i++)
// req.getInputStream().read(content);
//
// OCSPReq ocspReq = new OCSPReq(content);
// OCSPResp response = JamsCA.getOCSPResponse(ocspReq);
// if (response != null) {
// byte[] respBytes = response.getEncoded();
// resp.getOutputStream().write(respBytes);
// } else resp.setStatus(404);
//
// }
// catch (Exception e) {
// resp.sendError(404, "Could not find the requested certificate!");
// }
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment