Client authentication for rest api in tomcat

164 Views Asked by At

I have a Rest API and want to implement two way SSL in tomcat 9.I have imported client certificate in java cacert. I have used following code.

<code>
    <Connector
       clientAuth="true" port="443" minSpareThreads="5" maxSpareThreads="75"
       enableLookups="true" disableUploadTimeout="true"
       acceptCount="100" maxThreads="200"
       scheme="https" secure="true" SSLEnabled="true"
       keystoreFile="/opt/server.jks" keyAlias="abc.com"
       keystoreType="JKS" keystorePass="password"
       truststoreFile="/opt/server.jks"
       truststoreType="JKS" truststorePass="password"
       SSLVerifyClient="require" SSLEngine="on" SSLVerifyDepth="2" sslProtocol="TLS"
    />
</code>

But this is not working.Right now apis are accessible from anywhere.

0

There are 0 best solutions below