tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warner Onstine" <onst...@intalio.com>
Subject Re: [patch] Patch for SSL
Date Sat, 01 Jul 2000 23:00:26 GMT
Sorry my e-mail client mangled the patch, I have attached it.

-warner
----- Original Message -----
From: "Warner Onstine" <onstine@intalio.com>
To: <tomcat-dev@jakarta.apache.org>
Sent: Saturday, July 01, 2000 12:28 PM
Subject: [patch] Patch for SSL


> Hi all,
> I have added some variables and cleaned up some stuff in Costin's code.
It
> has been now set up for Client Auth.
>
> --------------------------------------------------
> Index: SSLSocketFactory.java
>
> ===================================================================
>
> RCS file:
>
/home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/net/SSLSocketFact
> ory.java,v
>
> retrieving revision 1.1
>
> diff -r1.1 SSLSocketFactory.java
>
> 96a97
>
> > private String keystore;
>
> 102a104,107
>
> > static String defaultKeystore = "JKS";
>
> > static String defaultProtocol = "TLS";
>
> > static String defaultAlgorithm = "SunX509";
>
> > static boolean defaultClientAuth = false;
>
> 151c156,157
>
> < String keystoreFile=(String)attributes.get("keystore");
>
> ---
>
> > file://Where is the server certificate at?
>
> > String keystoreFile=(String)attributes.get("keystoreFile");
>
> 153a160
>
> > file://Password for the server certificate
>
> 156a164,186
>
> > file://This is the type of keystore ie - JKS
>
> > keystore = (String)attributes.get("keystore");
>
> > if(keystore == null) keystore=defaultKeystore;
>
> >
>
> > file://determine whether we want client authentication
>
> > String clientAuthBool = (String)attributes.get("clientauth");
>
> >
>
> >
>
entAuthBool==null){ 
> 
> > clientAuth=defaultClientAuth;
> 
> > } else if(clientAuthBool.equalsIgnoreCase("true")){
> 
> > clientAuth = true;
> 
> > } else{
> 
> > clientAuth = false;
> 
> > }
> 
> > 
> 
> > file://protocol for the SSL ie - TLS, SSL v3 etc.
> 
> > String protocol = (String)attributes.get("protocol");
> 
> > if(protocol == null) protocol = defaultProtocol;
> 
> > 

>
> > file://Algorithm used to encode the certificate ie - SunX509
>
> > String algorithm = (String)attributes.get("algorithm");
>
> > if(algorithm == null) algorithm = defaultAlgorithm;
>
> >
>
> 164c194
>
> < com.sun.net.ssl.SSLContext.getInstance("TLS"); file://SSL
>
> ---
>
> > com.sun.net.ssl.SSLContext.getInstance(protocol); file://SSL
>
> 168c198
>
> < com.sun.net.ssl.KeyManagerFactory.getInstance("SunX509");
>
> ---
>
> > com.sun.net.ssl.KeyManagerFactory.getInstance(algo
> rithm);
>
> 177c207
>
> < context.init(kmf.getKeyManagers(), null, null);
>
> ---
>
> > context.init(kmf.getKeyManagers(), null, new
> java.security.SecureRandom());
>
> 203c233
>
> < socket.setNeedClientAuth(false);
>
> ---
>
> > socket.setNeedClientAuth(clientAuth);
>
> 212c242
>
> < KeyStore kstore=KeyStore.getInstance( "JKS" );
>
> ---
>
> > KeyStore kstore=KeyStore.getInstance(keystore);
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

Mime
View raw message