Client-client authentication at the pier (karafe)

I need to authenticate the client using a certificate on the jetty server.

I did it on Tomcat using:

<Connector
           protocol="org.apache.coyote.http11.Http11Protocol"
           port="8443" maxThreads="200"
           minSpareThreads="5" 
           enableLookups="true" disableUploadTimeout="true"
           acceptCount="100"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="D:\certificates\certs\server.jks" keystoreType="JKS" keystorePass="password"
           truststoreFile="D:\certificates\certs\trust_store.jks" truststoreType="JKS" truststorePass="password"
           clientAuth="true"
           sslProtocol="TLS"/>

      

But I want to do it on karaf, so I found out that I can do it by adding the following to jetty.xml:

<Call name="addConnector">
 <Arg>
   <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
     <Arg>
       <New class="org.eclipse.jetty.http.ssl.SslContextFactory">
         <Set name="KeyStore">./etc/keystores/server.jks</Set>
         <Set name="KeyStorePassword">password</Set>
         <Set name="KeyManagerPassword">password</Set>
         <Set name="TrustStore">./etc/keystores/trust_store.jks</Set>
         <Set name="TrustStorePassword">password</Set>
       </New>
     </Arg>
     <Set name="port">8443</Set>
     <Set name="maxIdleTime">30000</Set>
   </New>
 </Arg>

      

and follow org.ops4j.pax.web.xml:

org.osgi.service.http.port=8181
org.osgi.service.http.port.secure=8443
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.ssl.clientauthwanted=false
org.ops4j.pax.web.ssl.clientauthneeded=true

      

But it doesn't work for karaf, it doesn't ask for client certificate. It only works with https using only server-cert authentication.

What am I missing?

+3


source to share


1 answer


2 changes needed:



  • Renamed org.ops4j.pax.web.xml file to org.ops4j.pax.web.cfg
  • Added org.ops4j.pax.web.config.file=./etc/jetty.xml

    to org.ops4j.pax.web.cfg
+2


source







All Articles