[LON-CAPA-cvs] cvs: loncom / lonssl.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Wed, 26 May 2004 21:45:47 -0000
albertel Wed May 26 17:45:47 2004 EDT
Modified files:
/loncom lonssl.pm
Log:
- style police
Index: loncom/lonssl.pm
diff -u loncom/lonssl.pm:1.2 loncom/lonssl.pm:1.3
--- loncom/lonssl.pm:1.2 Wed May 26 07:12:58 2004
+++ loncom/lonssl.pm Wed May 26 17:45:46 2004
@@ -1,5 +1,5 @@
#
-# $Id: lonssl.pm,v 1.2 2004/05/26 11:12:58 foxr Exp $
+# $Id: lonssl.pm,v 1.3 2004/05/26 21:45:46 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -55,24 +55,24 @@
# IO::Socket::SSL
sub PromoteClientSocket {
- my $PlaintextSocket = shift;
- my $CACert = shift;
- my $MyCert = shift;
- my $KeyFile = shift;
-
- # To create the ssl socket we need to duplicate the existing
- # socket. Otherwise closing the ssl socket will close the plaintext socket
- # too:
-
- open (DUPLICATE, "+>$PlaintextSocket");
-
- my $client = IO::Socket::SSL->new_from_fd(fileno(DUPLICATE),
- SSL_user_cert => 1,
- SSL_key_file => $KeyFile,
- SSL_cert_file => $MyCert,
- SSL_ca_fie => $$CACert);
+ my $PlaintextSocket = shift;
+ my $CACert = shift;
+ my $MyCert = shift;
+ my $KeyFile = shift;
+
+ # To create the ssl socket we need to duplicate the existing
+ # socket. Otherwise closing the ssl socket will close the plaintext socket
+ # too:
+
+ open (DUPLICATE, "+>$PlaintextSocket");
+
+ my $client = IO::Socket::SSL->new_from_fd(fileno(DUPLICATE),
+ SSL_user_cert => 1,
+ SSL_key_file => $KeyFile,
+ SSL_cert_file => $MyCert,
+ SSL_ca_fie => $$CACert);
- return $client; # Undef if the client negotiation fails.
+ return $client; # Undef if the client negotiation fails.
}
#----------------------------------------------------------------------
@@ -91,27 +91,26 @@
# - Reference to an SSL socket on success
# - undef on failure. Reason for failure can be interrogated from
# IO::Socket::SSL
-sub PromoteServerSocket
-{
- my $PlaintextSocket = shift;
- my $CACert = shift;
- my $MyCert = shift;
- my $KeyFile = shift;
-
-
- # To create the ssl socket we need to duplicate the existing
- # socket. Otherwise closing the ssl socket will close the plaintext socket
- # too:
-
- open (DUPLICATE, "+>$PlaintextSocket");
-
- my $client = IO::Socket::SSL->new_from_fd(fileno(DUPLICATE),
- SSL_server => 1, # Server role.
- SSL_user_cert => 1,
- SSL_key_file => $KeyFile,
- SSL_cert_file => $MyCert,
- SSL_ca_fie => $$CACert);
- return $client;
+sub PromoteServerSocket {
+ my $PlaintextSocket = shift;
+ my $CACert = shift;
+ my $MyCert = shift;
+ my $KeyFile = shift;
+
+
+ # To create the ssl socket we need to duplicate the existing
+ # socket. Otherwise closing the ssl socket will close the plaintext socket
+ # too:
+
+ open (DUPLICATE, "+>$PlaintextSocket");
+
+ my $client = IO::Socket::SSL->new_from_fd(fileno(DUPLICATE),
+ SSL_server => 1, # Server role.
+ SSL_user_cert => 1,
+ SSL_key_file => $KeyFile,
+ SSL_cert_file => $MyCert,
+ SSL_ca_fie => $$CACert);
+ return $client;
}
#-------------------------------------------------------------------------
@@ -127,9 +126,9 @@
# NONE
#
sub Close {
- my $Socket = shift;
+ my $Socket = shift;
- $Socket->close(SSL_no_shutdown =>1); # Otherwise the parent socket
- # gets torn down.
+ $Socket->close(SSL_no_shutdown =>1); # Otherwise the parent socket
+ # gets torn down.
}