Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

tomcat ssl configuration

 
Greenhorn
Posts: 17
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
step:1
C:\tomcat7\conf\tomcat-users.xml (edit)






step:2
create folders
C:\tomcat7\webapps\MyApps
C:\tomcat7\webapps\MyApps\WEB-INF
C:\tomcat7\webapps\MyApps\WEB-INF\classes

step:3
create web.xml file
C:\tomcat7\webapps\MyApps\WEB-INF\web.xml (edit)




step:4
create WelcomeServlet
C:\tomcat7\webapps\MyApps\WEB-INF\classes\WelcomeServlet.java
C:\tomcat7\webapps\MyApps\WEB-INF\classes\WelcomeServlet.class



step-5

in cmd type
C:\Users\lokesh>keytool -genkey -alias tomcat -keyalg RSA
password:system
retype:system
name:ravi suthar
unit:student
org:gdcst
city:vadodara
state:gujurat
counrty:IN
:yes
password:system
retype:system

step:6
put keystore in
C:\tomcat7\webapps\MyApps\WEB-INF\.keystore


step:7
uncommnet server.xml



step:8
https://localhost:8443


problem
the MyApps application not using https://localhost:8443/myapps/
how to use https

This webpage is not available
The webpage at https://localhost:8443/MyApps/ might be temporarily down or it may have moved permanently to a new web address.
Here are some suggestions:
Reload this web page later.
Error 7 (net::ERR_TIMED_OUT): The operation timed out.



if i start http at 8443 then
SSL connection error
Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
 
Saloon Keeper
Posts: 22498
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Ravi!

There's a "Code" button on our message editor that inserts/wraps a special tag around preformatted text such as Java code and XML. It makes them easier for people to read.

I do not recommend building a java webapp by brute-force assembling a WAR in the Tomcat webapps directory. It's much better to have your own project directory, assemble the WAR there, and then deploy the results into Tomcat.

Also, in order to use the tomcat-users.xml file, you'll have to enable the corresponding Tomcat Realm (security plugin). It's commented out by default. But that's not your main problem right now.

Your major problem is that the .keystore isn't where tomcat thinks it is. The keystore is part of the server, not part of the webapp, so it should never be located inside a WAR. But, in any event, it's better to provide an absolute path to the keystore file than to use a relative path.
 
ravi suthar
Greenhorn
Posts: 17
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you sir for the replying
now this time
i have a create war file of my project, the web.xml entry is



i have generate the key using

and put this file at C:\server.keystore


server.xml entry is




i deploy my war file in tomcat
and start server,this is start at http:localhost:8080/

when i click to my project in tomcat manager
my project url is:https://localhost:8443/Ganesha/


but the browser says:

This webpage is not available
The webpage at https://localhost:8443/Ganesha/ might be temporarily down or it may have moved permanently to a new web address.
Here are some suggestions:
Reload this web page later.
Error 7 (net::ERR_TIMED_OUT): The operation timed out
 
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if this will help but I had a more complicated problem that ended up with a pretty slick solution.

My issue is I need to use Shibboleth for the authentication over https. Tomcat doesn't do that so I used Apache as a "reverse proxy".

This allows Apache to do the ssl, authentication and redirections. Since Tomcat is not exposed to the Internet it doesn't have to deal with any of that.

One thing I especially like is that users point to a url lke https://example.com/myapp/ and don't have to add port numbers for Tomcat.

The Apache directive you may want to investigate is ProxyPass.

It's another way to do it, I apologize that it doesn't answer your question.

Joe
 
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic