Search in sources :

Example 1 with OcspServer

use of org.xipki.ocsp.server.impl.OcspServer in project wildfly by wildfly.

the class TestingOcspServer method start.

public void start() throws Exception {
    Assert.assertNull("OCSP server already started", ocspServer);
    ocspServer = new OcspServer();
    ocspServer.setConfFile(TestingOcspServer.class.getResource("ocsp-responder.xml").getFile());
    securityFactory.setSignerFactoryRegister(new SignerFactoryRegisterImpl());
    ocspServer.setSecurityFactory(securityFactory);
    ocspServer.init();
    HttpOcspServlet servlet = new HttpOcspServlet();
    servlet.setServer(ocspServer);
    server = new ClientAndServer(port);
    server.when(request().withMethod("POST").withPath("/ocsp"), Times.unlimited()).respond(request -> getHttpResponse(request, servlet));
    server.when(request().withMethod("GET").withPath("/ocsp/.*"), Times.unlimited()).respond(request -> getHttpResponse(request, servlet));
}
Also used : HttpOcspServlet(org.xipki.ocsp.server.impl.HttpOcspServlet) SignerFactoryRegisterImpl(org.xipki.security.SignerFactoryRegisterImpl) ClientAndServer(org.mockserver.integration.ClientAndServer) OcspServer(org.xipki.ocsp.server.impl.OcspServer)

Aggregations

ClientAndServer (org.mockserver.integration.ClientAndServer)1 HttpOcspServlet (org.xipki.ocsp.server.impl.HttpOcspServlet)1 OcspServer (org.xipki.ocsp.server.impl.OcspServer)1 SignerFactoryRegisterImpl (org.xipki.security.SignerFactoryRegisterImpl)1