Snox
Snox

Reputation: 588

Spring web and tomcat with https

I have a web application that is running in tomcat, and i want it to used HTTPS instead of HTTP. I've created a self signed certificate so the server can use it for authentication during the handshake. The thing is, i can't seem to get it running in https, although when i try to access tomcat home it works fine with https.

I've configured my server.xml

<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />




<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               keystoreFile="c:\Users\keystore" 
               keystorePass="testing"
               clientAuth="false" sslProtocol="TLS" />

I am using spring web. I am missing something? Thank you

Upvotes: 0

Views: 102

Answers (1)

Snox
Snox

Reputation: 588

I had a similar problem a few months ago. Try to add this to your web.xml

<security-constraint>
        <web-resource-collection>
            <web-resource-name>Project Name</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

Upvotes: 1

Related Questions