Search code examples
angularspring-bootssltls1.2tomcat9

How to add TLS to a particular context path in tomcat


How to add TLS to a particular context path in tomcat server rather than adding it to a port ?

I have deployed a spring boot gateway service and a angular app in tomcat to the same port with different context path, and i want to add 2 different TLS certificate to both of these.

But currently im only able to add it to the port and i want to add one tls cert to the angular app and another tls cert to gateway service.


Solution

  • The path of the URL (which is needed for context path) is only known after the TLS handshake has finished, because only then the actual HTTP request containing the path is sent. Therefore it is not possible to have different TLS settings for different path.