I am building a sever application using java 8 and spring boot and it is deployed in tomcat 8. This application is invoked from another application only, and not from any browser. So two-way SSL handshake is implemented for security reasons.
Two-way SSL is implemented and I am aware of forcing the Host name verification when acting as a SSL client. Hostname verification should be enabled at SSL server end also. Is there any implementation similar to strict hostname verification when acting as SSL server.
The server should do a host name verification from SSL certificate provided by the client against the client IP address available in the request object.
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
sslcontext, new String[] { "TLSv1.2" }, null, SSLSocketFactory.STRICT_HOSTNAME_VERIFIER);
return HttpClients.custom().setSSLSocketFactory(sslsf).build();
I am using Apache http client and able to force STRICT_HOSTNAME_VERIFIER when acting as SSL client.
I am not getting any pointer to do the same kind of check when acting as a SSL Server. Even if the SSL client certificate has a different hostname than the client-server it is requesting from, the SSL handshake is passing without any failure. Is there a way to enable strict host name verifier from the SSL server point f view using java security.
I am using the below configuration in tomcat
<Connector port="9443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true"
maxThreads="100" minSpareThreads="10" maxConnections="1000" scheme="https" secure="true"
keystoreFile="conf/jks/SSL_Server.jks" keystorePass="Password" keystoreType="jks"
truststoreFile="conf/jks/TrustStore.jks" truststorePass="PasswordTrust" truststoreType="jks"
clientAuth="true" sslProtocol="TLSv1.2" />