Solved

ssl subdomains in tomcat?

Posted on 2012-03-12
4
833 Views
Last Modified: 2012-04-10
I have say

https://sub1.domain.com  
https://sub2.domain.com  

The ssl cert is a wildcard cert.  Do I have to use IP based hosting in tomcat or can I use name-based hosting?
0
Comment
Question by:casit
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:rowansmith
Comment Utility
You can use name based hosting.  The Server will always return the same certificate no matter what domain the user is going too.  So long as the certificate matches the domain which the user is destined for the user will not get a certificate mismatch error.
0
 

Author Comment

by:casit
Comment Utility
How would I set that up in the config file?  I haven't had to configure tomcat alot.
0
 
LVL 11

Accepted Solution

by:
rowansmith earned 500 total points
Comment Utility
Create an SSL connector that uses the Wildcard Certificate.  Then create Virtual Hosts that are bound to that connector.

<Server port="8005" shutdown="SHUTDOWN" debug="0">
  <Service name="Tomcat-Standalone">
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
			port="8080" minProcessors="5" maxProcessors="75"
			enableLookups="true" redirectPort="8443"/>
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
			port="8443" minProcessors="5" maxProcessors="75"
			acceptCount="10" debug="0" scheme="https" secure="true"/>
      <Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
			clientAuth="false" protocol="TLS" />
    </Connector>
    <Engine name="Standalone" defaultHost="localhost" debug="0">
      <!-- This Host is the default Host -->
      <Host name="localhost" debug="0" appBase="webapps"
	      unpackWARs="true" autoDeploy="true">
        <Context path="" docBase="ROOT" debug="0"/>
        <Context path="/orders" docBase="/home/ian/orders" debug="0"
                       reloadable="true" crossContext="true">
        </Context>
      </Host>

      <!-- This Host is the first "Virtual Host": www.example.com -->
      <Host name="www.example.com" appBase="/home/example/webapp">
        <Context path="" docBase="."/>
      </Host>

    </Engine>
  </Service>
</Server>

Open in new window


You'll find a good description of it all here.  Effectively it is exactly the same as creating a Virtual Host setup without SSL.  All you are doing is adding SSL to the Connector which the Host entries are bound too.
0
 

Author Comment

by:casit
Comment Utility
How would I make SSL listen on port 443 and forward all traffic on port 80 to the appropriate virtual host on 443?
0

Featured Post

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Join & Write a Comment

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now