Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6386693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:03:29+00:00 2026-05-25T03:03:29+00:00

I configured an instance of Tomcat following this article: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html . I commented out

  • 0

I configured an instance of Tomcat following this article: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html. I commented out HTTP connector because I want my demo application to be accessible only via HTTPS. I configured HTTPS connector as such:

   <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" keystorePass="nopass"
           keystoreFile="/home/someuser/.keystore" keyAlias="tomcat" />

Everything works fine when I hit the URL of the my demo application’s servlet using HTTPS.

When I tried to hit it using HTTP URL, I expected it to return 403 or similar error. Instead I got download of some small (11 bytes?) binary file with the name matching the name of the servlet.

Did anyone experienced similar issue? How did you resolve it? What should I check to make sure I did everything right?

EDIT: I tried hitting the same connector using curl instead of the browser and noticed that it doesn’t return any headers. Oh, and the size of the response is 7 bytes, not 11.

EDIT 2: This is the security-related part of the web.xml of my demo application:

<security-constraint>
    <web-resource-collection>
        <web-resource-name>Secure Servlet</web-resource-name>
        <url-pattern>/SecureServlet</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    <auth-constraint>
        <role-name>connect</role-name>
    </auth-constraint>
</security-constraint>

<security-role>
    <description>The role required to connect to the application
    </description>
    <role-name>connect</role-name>
</security-role>

<login-config>
    <auth-method>BASIC</auth-method>
</login-config>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:03:29+00:00Added an answer on May 25, 2026 at 3:03 am

    I have tested this by commenting out the HTTP Connector in server.xml forcing the app to work on HTTPS

    https://localhost:8443/testapp

    works as expected

    http://localhost:8080/testapp

    returns a 404

    http://localhost:8443/testapp

    Note the incorrect mix of protocol and port returns a small stream of garbage which is rendered in IE and as binary in Firefox

    this is of 7 bytes

    Can you recheck if you are seeing the 3rd scenario which should not happen in a natural case but only if someone fiddles with the URL?

    Okay, I tested using CONFIDENTIAL but it still does not redirect the http on 8443 to https. I’m guessing that only comes into picture when the user has tried http on the valid 8080 port.

    Using Fiddler, I see that the headers coming back are non-existent and the junk response.

    HTTP/1.1 200 This buggy server did not return headers

    This seems to be the standard behaviour, and end-users who access the app in this manner will see junk as expected.

    If you really need to, you could try writing your own custom Tomcat Valve which acts like a Filter to take care of this special case and redirect the users to SSL

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SSL configuration in Java/Tomcat being what it is, I configured a tomcat6 instance to
I configured a jail with Chroot in SSH following this tutorial . I found
I'm trying to configure org.apache.commons.dbcp.BasicDataSource as bean in web.xml under a tomcat project using
I've got the following scenario: On the one hand, I've got a tomcat instance
I have a tomcat instance setup but the database connection I have configured in
Ran into another problem using SSL and Tomcat: I've configured a keystore which contains
I have to manually deploy my servlet war packages on an Apache tomcat instance
i have configured my apache instance to delegate requests to a application running on
My application gets configured via a lot of key/values (let's say 30.000 for instance)
Web app runs on Tomcat. Datasource is configured with Spring configuration, and is used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.