Contact Us
  
 
 
    SearchSearch   RegisterRegister   Log inLog in 

SSL implement in tomcat and java certificate

SSL implement in tomcat and java certificate

 
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans
View previous topic :: View next topic  
Author Message
admin
Site Admin


Joined: 24 Aug 2006
Posts: 30

PostPosted: Mon Apr 02, 2007 4:11 pm    Post subject: SSL implement in tomcat and java certificate Reply with quote




you can create certificate
1. Buy certificate from company.
2. Create own certificate through sun java keytools

2 option
working as

A "Connector" represents an endpoint by which requests are received
and responses are returned. Each Connector passes requests on to the
associated "Container" (normally an Engine) for processing.

By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
You can also enable an SSL HTTP/1.1 Connector on port 8443 by
following the instructions below and uncommenting the second Connector
entry. SSL support requires the following steps (see the SSL Config
HOWTO in the Tomcat 5 documentation bundle for more detailed
instructions):
* If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
* Execute:
Quote:
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)

with a password value of "changeit" for both the certificate and
the keystore itself.

By default, DNS lookups are enabled when a web application calls
request.getRemoteHost(). This can have an adverse impact on
performance, so you can disable it by setting the
"enableLookups" attribute to "false". When DNS lookups are disabled,
request.getRemoteHost() will return the String version of the
IP address of the remote client.


and finally
uncommented code in

tomcat conf/server.xml file

Code:
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
   
    <Connector port="8443"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" debug="0" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
   

restart your tomcat

open browser with
https://localhost:8443/
Back to top
View user's profile Send private message Send e-mail
javatech



Joined: 19 Jan 2007
Posts: 39

PostPosted: Sun Dec 07, 2008 5:58 am    Post subject: Reply with quote

SSL can implement in web easily. JDK itself provides toolkit to implement free certificate of SSL in tomcat.

If you want to use free SSL certificate

use this command at command prompt of windows

Quote:
C:\jdk1.6.0_03\bin>keytool -genkey -alias tomcat -keyalg RSA

Quote:

Enter keystore password:

Quote:
Re-enter new password:


Quote:
What is your first and last name?
[Unknown]:


Quote:
What is the name of your organizational unit?
[Unknown]:


Quote:
What is the name of your organization?
[Unknown]:


Quote:

What is the name of your City or Locality?
[Unknown]:

Quote:

What is the two-letter country code for this unit?
[Unknown]:


Quote:
What is the name of your State or Province?
[Unknown]:


Quote:
Enter key password for <tomcat>
(RETURN if same as keystore password):


It will ask more option e.g password, company name, state, contact information

Configure tomcat if you using with port 8443

Quote:
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />



Just done

access web pages from tomcat with 8443 port

you will see https instead of http
Back to top
View user's profile Send private message
hanifp83



Joined: 31 Mar 2009
Posts: 1

PostPosted: Tue Mar 31, 2009 4:42 am    Post subject: Reply with quote

when i am executing u r instructions whatever u metioned in above
Quote:
keytool -genkey -alias tomcat -keyalg RSA

i got one error
Quote:
D:\\Java\\jdk1.6.0\\bin>keytool -genkey -alias tomcat -keyalg RSA Enter keystore password: keytool error: java.lang.Exception: Key pair not generated, alias already exists


plz send me solution
Back to top
View user's profile Send private message
seniormember
Site Admin


Joined: 20 Jul 2008
Posts: 77

PostPosted: Tue Mar 31, 2009 4:55 am    Post subject: Reply with quote

You have to add all values when it asked to enter

Maybe you have entered wrong password in confirm password
or not matched both password.

and give more details that you did

then we can follow that steps and give you solution
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans All times are GMT
Page 1 of 1

 
Jump to:  
  Quick Post a Reply Topic
     
  Name (required)  
     
  Email Address (will not be published) (required)  
     
  Subject of topic (required)  
     
   
     
   
     
  Advertisement  
     
 
     


  More Links  
 
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack