Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

have a misunderstanding what's going on with Tomcat!

I have my app deployed as ROOT.war on Tomcat. Have one URL that I want to be reached only via SSL.

Tomcat process this URL good:

http://localhost:443/securedUrl

and don't process this URL:

https: //localhost/securedUrl

Why?

A piece of $CATALINA_HOME/conf/server.xml:

<Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="443" />

    <Connector  port="443" 
                maxThreads="150" 
                minSpareThreads="25" 
                maxSpareThreads="75" 
                enableLookups="true" 
                disableUploadTimeout="true"
                acceptCount="100" 
                debug="0" 
                scheme="https" 
                secure="true"
                clientAuth="false" 
                sslProtocol="TLS"
                keystoreFile="/webapps/ROOT/myapp.keystore.bin"
                keystorePass="lalala" />

A piece of $CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml:

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>secured_postbacks</web-resource-name>
            <url-pattern>/securedUrl</url-pattern>
        </web-resource-collection>

        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
      </security-constraint>

</web-app>
share|improve this question

migrated from stackoverflow.com Jul 19 '10 at 11:27

This question came from our site for professional and enthusiast programmers.

1  
Are you running this on a *nix machine ? If so, are you running tomcat as root - otherwise it won't be able to bind to ports < 1024 , by default. Check the log files in logs/* as well - maybe it e.g. has trouble loading your keystore –  nos Jul 19 '10 at 11:14
    
two yes and one no: 1) yes, this is unix 2) yes, i am root 3) no, not found any criminal in log files regarding this issue –  IvanR Jul 19 '10 at 13:52
add comment

1 Answer

up vote 3 down vote accepted

HTTP can happily run on port 443. HTTPS is not HTTP - it's HTTP over TLS or SSL - and it can happily run on port 80.

They're simply not the same: http://localhost:443/securedUrl and https://localhost/securedUrl do not point to the same resource.

share|improve this answer
    
OMG, thank you very much!!!1 Didn't know that! Great thanks! –  IvanR Jul 19 '10 at 13:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.