I stuck with an issue where I want to validate crl. I already have a keystore at ${karaf.home}/etc/keystores and would like just to add a crl(CertificateRevocation list) How to do that? Here's my org.ops4j.pax.web.cfg:
org.osgi.service.http.port=8030
org.osgi.service.http.port.secure=9000
org.osgi.service.http.secure.enabled=true
org.ops4j.pax.web.ssl.keystore=./etc/keystores/keystore.jks
org.ops4j.pax.web.ssl.password=password
org.ops4j.pax.web.ssl.keypassword=password
org.ops4j.pax.web.config.file=${karaf.home}/etc/jetty.xml
org.ops4j.pax.web.ssl.truststore=${karaf.base}/etc/keystores/client.jks
org.ops4j.pax.web.ssl.truststore.password=password
org.ops4j.pax.web.ssl.truststore.type=JKS
Here's my jetty.xml:
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
<Set name="KeyStorePath"><Property name="jetty.home" default="." />/etc/keystores/keystore.jks</Set>
<Set name="KeyStorePassword">password</Set>
<Set name="KeyManagerPassword">secretpass</Set>
<Set name="TrustStorePath"><Property name="jetty.home" default="." />/etc/keystores/client.jks</Set>
<Set name="TrustStorePassword">password</Set>
<Set name="CrlPath"><Property name="jetty.home" default="." />/etc/keystores/test-cer-.crl</Set>
<Set name="NeedClientAuth">true</Set>
</New>
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.ServerConnector">
<Arg name="server">
<Ref refid="Server" />
</Arg>
<Arg name="factories">
<Array type="org.eclipse.jetty.server.ConnectionFactory">
<Item>
<New class="org.eclipse.jetty.server.SslConnectionFactory">
<Arg name="next">http/1.1</Arg>
<Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
</New>
</Item>
<Item>
<New class="org.eclipse.jetty.server.HttpConnectionFactory"></New>
</Item>
</Array>
</Arg>
<Set name="host">
<Property name="jetty.host" default="0.0.0.0" />
</Set>
<Set name="port">
<Property name="jetty.port" default="14000" />
</Set>
<Set name="idleTimeout">
<Property name="http.timeout" default="30000" />
</Set>
<Set name="name">restConnector:14000</Set>
</New>
</Arg>
</Call>
But when I try to open https://localhost:14000/ in my browser I get Secure Connection Failed error. means I end up with an error where Jetty tries to validate the subject alternative name of the client certificate. And of course there is none,I was not able to figure out how to disable this client hostname validation.it works fine with port 9000.
Do I miss something in the jetty configuration? Any help will be appreciated. OR is there any other way to do it?