Solved

ssl subdomains in tomcat?

Posted on 2012-03-12
4
849 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
ID: 37712907
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
ID: 37713029
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
ID: 37713126
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
ID: 37830801
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need to redirect request from IIS server to old Apache Server. 3 113
ColdFusion Rereplace 3 78
listing all functions in JavaScript 19 200
WEB Farm 6 69
Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

813 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

14 Experts available now in Live!

Get 1:1 Help Now