CVS: beepcore-java/tls/org/beepcore/beep/profile/tls/ptls TLSProfilePureTLS.java,1.5,1.6

Huston Franklin <[email protected]> Sat, 05 Oct 2002 08:45:58 -0700
Newsgroups gmane.network.beep.beepcore.java.cvs
Message-ID <[email protected]>
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls
In directory usw-pr-cvs1:/tmp/cvs-serv15890/tls/org/beepcore/beep/profile/tls/ptls

Modified Files:
	TLSProfilePureTLS.java 
Log Message:
changed to use commons-logging

Index: TLSProfilePureTLS.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls/TLSProfilePureTLS.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** TLSProfilePureTLS.java	9 Nov 2001 18:41:23 -0000	1.5
--- TLSProfilePureTLS.java	5 Oct 2002 15:45:56 -0000	1.6
***************
*** 25,33 ****
  import java.security.PrivateKey;
  
  import org.beepcore.beep.core.*;
  import org.beepcore.beep.profile.*;
  import org.beepcore.beep.profile.tls.TLSProfile;
  import org.beepcore.beep.transport.tcp.*;
- import org.beepcore.beep.util.*;
  
  import COM.claymoresystems.ptls.*;
--- 25,35 ----
  import java.security.PrivateKey;
  
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+ 
  import org.beepcore.beep.core.*;
  import org.beepcore.beep.profile.*;
  import org.beepcore.beep.profile.tls.TLSProfile;
  import org.beepcore.beep.transport.tcp.*;
  
  import COM.claymoresystems.ptls.*;
***************
*** 110,113 ****
--- 112,117 ----
          "Private Key Type";
  
+     private Log log = LogFactory.getLog(this.getClass());
+ 
      // properties set from the configuration
      boolean needPeerAuth = true;
***************
*** 403,415 ****
                                oldSocket.getPort(), SSLSocket.SERVER);
          } catch (BEEPException e) {
!             Log.logEntry(Log.SEV_ERROR, e.getMessage());
              e.printStackTrace();
              oldSession.terminate(e.getMessage());
          } catch (SSLThrewAlertException e) {
!             Log.logEntry(Log.SEV_ERROR, e.getMessage());
              e.printStackTrace();
              oldSession.terminate(e.getMessage());
          } catch (IOException e) {
!             Log.logEntry(Log.SEV_ERROR, e.getMessage());
              e.printStackTrace();
              oldSession.terminate(e.getMessage());    
--- 407,419 ----
                                oldSocket.getPort(), SSLSocket.SERVER);
          } catch (BEEPException e) {
!             log.error(e.getMessage());
              e.printStackTrace();
              oldSession.terminate(e.getMessage());
          } catch (SSLThrewAlertException e) {
!             log.error(e.getMessage());
              e.printStackTrace();
              oldSession.terminate(e.getMessage());
          } catch (IOException e) {
!             log.error(e.getMessage());
              e.printStackTrace();
              oldSession.terminate(e.getMessage());    
***************
*** 423,429 ****
                  cc = newSocket.getCertificateChain();
                  if (cc == null) {
!                     Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                                  "No certificate chain when there should " +
!                                  "be one. ");
                      throw new StartChannelException(550, "No certificate " +
                                                      "chain when there " +
--- 427,431 ----
                  cc = newSocket.getCertificateChain();
                  if (cc == null) {
!                     log.trace("No certificate chain when there should be one.");
                      throw new StartChannelException(550, "No certificate " +
                                                      "chain when there " +
***************
*** 435,444 ****
                      String subject = cert.getSubjectName().getNameString();
                      String issuer = cert.getIssuerName().getNameString();
!                     Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                                  "Name = " + subject + " issued by " + issuer);
                  }
              } else {
!                 Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                              "No peer authentication needed");
              }
  
--- 437,446 ----
                      String subject = cert.getSubjectName().getNameString();
                      String issuer = cert.getIssuerName().getNameString();
!                     if (log.isTraceEnabled()) {
!                         log.trace("Name = " + subject + " issued by " + issuer);
!                     }
                  }
              } else {
!                 log.trace("No peer authentication needed");
              }
  
***************
*** 490,494 ****
  
              // @todo should be more detailed
!             Log.logEntry(Log.SEV_ERROR, x.getMessage());
              x.printStackTrace();
  
--- 492,496 ----
  
              // @todo should be more detailed
!             log.error(x.getMessage());
              x.printStackTrace();
  
***************
*** 517,521 ****
      public void closeChannel(Channel channel) throws CloseChannelException
      {
!         Log.logEntry(Log.SEV_DEBUG, "Closing TLS channel.");
      }
  
--- 519,523 ----
      public void closeChannel(Channel channel) throws CloseChannelException
      {
!         log.debug("Closing TLS channel.");
      }
  
***************
*** 563,567 ****
          }
  
!         Log.logEntry(Log.SEV_DEBUG, "Staring TLS channel.");
  
          // Freeze IO and get the socket and reset it to TLS
--- 565,569 ----
          }
  
!         log.debug("Staring TLS channel.");
  
          // Freeze IO and get the socket and reset it to TLS
***************
*** 598,603 ****
                  cc = newSocket.getCertificateChain();
                  if (cc == null) {
!                     Log.logEntry(Log.SEV_DEBUG_VERBOSE, "No certificate " +
!                                  "chain when there should be one. ");
                      throw new BEEPException("No certificate chain when " +
                                              "there should be one. ");
--- 600,604 ----
                  cc = newSocket.getCertificateChain();
                  if (cc == null) {
!                     log.trace("No certificate chain when there should be one.");
                      throw new BEEPException("No certificate chain when " +
                                              "there should be one. ");
***************
*** 608,617 ****
                      String subject = cert.getSubjectName().getNameString();
                      String issuer = cert.getIssuerName().getNameString();
!                     Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                                  "Name = " + subject + " issued by " + issuer);
                  }
              } else {
!                 Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                              "No peer authentication needed");
              }
  
--- 609,618 ----
                      String subject = cert.getSubjectName().getNameString();
                      String issuer = cert.getIssuerName().getNameString();
!                     if (log.isTraceEnabled()) {
!                         log.trace("Name = " + subject + " issued by " + issuer);
!                     }
                  }
              } else {
!                 log.trace("No peer authentication needed");
              }
  



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf