1

I do have a Tomcat8 server running, currently in the development environment. It's been working for a while on the port we have picked (8085) and was available outside of our network (unblocked on the firewall). Recently we have made decision to run https also. I did configure our certificate and added connector directive for SSL in server.xml.

Unfortunately it's not working as expected. SSL is working perfectly fine when I try to open it via remote desktop browser (in fact - on the localhost) it work both on https://localhost:8443 and https://domain.com:8443. Until this point everything works fine and as expected but when we try to access it from the other network it's not working, just gives a time out when we try to access https://domain.com:8443 but http://domain.com:8085 works just fine outside.

We did think that it might be something with our firewall although we have decided to disable it for a while and it's still not working.

Any idea what might cause it?

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
    <Connector port="8085" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

    <Connector port="8443" 
        protocol="HTTP/1.1" SSLEnabled="true"
        maxThreads="150" scheme="https" secure="true" alias="tomcat"
        keystoreFile="c:/cert_pn_2015.p12"
        keystorePass="PASS" 
        keystoreType="PKCS12"/>

    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.LockOutRealm">

        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>
0

You are redirecting 8085 to 8443 which gives me the idea that 8443 is closed. When it reaches 8085 tomcat redirects the traffic internally on 8443(acts like a proxy). Do a telnet on 8443 and you will find out.

Please have a look here https://tomcat.apache.org/tomcat-8.0-doc/config/http.html

  • I must have not explain myself clearly. When I hit 8085 it does show me page over http. Doesn't do redirect. – SirKometa Mar 11 '16 at 14:38
  • Indeed and this is because of how the redirect page works for the Tomcat connector. Please have a look here tomcat.apache.org/tomcat-8.0-doc/config/http.html. Will add it to the response – Alex H Mar 11 '16 at 14:40
  • I did remove redirectPort from 8085 connector and it didn't help. The biggest problem is that it works while connecting from localhost. That's what I wonder why it doesn't work outside. – SirKometa Mar 11 '16 at 14:46
  • Go on another server( from where it does not work) and go with telnet hostname 8443. Does that work? – Alex H Mar 11 '16 at 14:50
  • Looks like telnet works – SirKometa Mar 11 '16 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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