BUG#: 7467
authorthilo.boehm <thilo.boehm>
Tue, 18 Mar 2008 15:18:39 +0000 (15:18 +0000)
committerthilo.boehm <thilo.boehm>
Tue, 18 Mar 2008 15:18:39 +0000 (15:18 +0000)
TITLE: z/OS only Add new log messages at accepting SSL connection. (V2.7)

DESCRIPTION: Add new log and trace messages.

src/Pegasus/Common/SocketzOS_inline.h
src/Pegasus/msg/Server/pegasusServer_en.txt

index f1dcbc8010f0afdcf3faeafe18e81ed17b89f82b..61f01dcf4fea44b8eb1b2b49ec4320b9267f5a6d 100644 (file)
@@ -107,8 +107,12 @@ int MP_Socket::ATTLS_zOS_query()
            case(EINPROGRESS):
            case(EWOULDBLOCK):
            {
-               PEG_TRACE_CSTRING(TRC_SSL, Tracer::LEVEL4,
-                   "Accept pending (EWB).");
+               PEG_TRACE((TRC_SSL, Tracer::LEVEL4,
+                   "Accept pending: %s (error code %d, reason code 0x%08X).", 
+                   strerror(errnoIoctl),
+                   errnoIoctl,
+                   errno2Ioctl));
+               PEG_METHOD_EXIT();
                // accept pending
                return 0; 
            }
@@ -121,6 +125,21 @@ int MP_Socket::ATTLS_zOS_query()
                        "ATTLS reset the connection due to handshake failure. "
                        "Connection closed.");
                PEG_METHOD_EXIT();
+               // close socket
+               return -1;
+           }
+           case(ENOTCONN):
+           {
+               int socket_errno;
+               SocketLength optlen = sizeof(int);
+               getsockopt(_socket, SOL_SOCKET, SO_ERROR,
+                   (char*)&socket_errno, &optlen);
+               PEG_TRACE((TRC_DISCARDED_DATA, Tracer::LEVEL2,
+                   "Client not connected to ATTLS. Closing socket %d : "
+                       "%s (error code %d)",
+                   _socket,strerror(socket_errno),socket_errno));
+               PEG_METHOD_EXIT();
+               // close socket
                return -1;
            }
            default:
@@ -130,12 +149,13 @@ int MP_Socket::ATTLS_zOS_query()
                Logger::put_l(
                    Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
                    "Pegasus.Common.SocketzOS_inline.UNEXPECTED_ERROR",
-                       "An unexpected error occurs: $0 ( errno $1, reason "
-                       "code 0x$2 ). Connection closed.",
+                   "An unexpected error occurs: $0 ( errno $1, reason code "
+                      "0x$2 ). Connection closed.",
                    strerror(errnoIoctl),
                    errnoIoctl,
                    str_errno2);
                PEG_METHOD_EXIT();
+               // close socket
                return -1;
            }
        } // end switch(errnoIoctl)
@@ -146,7 +166,29 @@ int MP_Socket::ATTLS_zOS_query()
     switch(ioc.TTLSi_Stat_Policy)
     {
         case(TTLS_POL_OFF):
+        {
+            Logger::put_l(
+                Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
+                "Pegasus.Common.SocketzOS_inline.POLICY_OFF",
+                "ATTLS is not active for TCP-IP stack the CIM server "
+                    "is using for HTTPS connections. "
+                    "Communication not secured. Connection closed.");
+            PEG_METHOD_EXIT();
+            // close socket
+            return -1;
+        }
         case(TTLS_POL_NO_POLICY):
+        {
+            Logger::put_l(
+                Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
+                "Pegasus.Common.SocketzOS_inline.NO_POLICY",
+                "There is no ATTLS policy found for the CIM server "
+                    "HTTPS connections. "
+                    "Communication not secured. Connection closed.");
+            PEG_METHOD_EXIT();
+            // close socket
+            return -1;
+        }
         case(TTLS_POL_NOT_ENABLED):
         {
             Logger::put_l(
@@ -155,6 +197,7 @@ int MP_Socket::ATTLS_zOS_query()
                 "ATTLS policy is not active for the CIM Server HTTPS port. "
                     "Communication not secured. Connection closed.");
             PEG_METHOD_EXIT();
+            // close socket
             return -1;
         }
         case(TTLS_POL_ENABLED):
@@ -171,6 +214,7 @@ int MP_Socket::ATTLS_zOS_query()
                 "ATTLS policy not valid for CIM Server. "
                     "Set ApplicationControlled to OFF. Connection closed.");
             PEG_METHOD_EXIT();
+            // close socket
             return -1;
         }
 
@@ -183,7 +227,9 @@ int MP_Socket::ATTLS_zOS_query()
         case(TTLS_CONN_HS_INPROGRESS):
         {
             // the SSL handshake has not been finished yet, try late again.
-            PEG_TRACE_CSTRING(TRC_SSL, Tracer::LEVEL4, "---> Accept pending.");
+            PEG_TRACE_CSTRING(TRC_SSL, Tracer::LEVEL4, 
+                 "ATTLS reports SSL handshake pending.");
+            // accept pending
             return 0;
         }
         case(TTLS_CONN_SECURE):
@@ -208,6 +254,7 @@ int MP_Socket::ATTLS_zOS_query()
                     "CIM Server HTTPS port. Communication not secured. "
                     "Connection closed.");
             PEG_METHOD_EXIT();
+            // close connection
             return -1;
 
         }
@@ -220,6 +267,7 @@ int MP_Socket::ATTLS_zOS_query()
             PEG_TRACE_CSTRING(TRC_SSL, Tracer::LEVEL4,
                 "ATTLS Security Type is valid but no SAFCHK.");
             PEG_METHOD_EXIT();
+            // successfull return
             return 1;
         }
 
@@ -234,6 +282,7 @@ int MP_Socket::ATTLS_zOS_query()
                 "ATTLS Security Type is SAFCHK. Resolved user ID \'%s\'",
                 _username));
             PEG_METHOD_EXIT();
+            // successfull return
             return 1;
 
         }
index faa9c6e7bc3420db210f47eca2acb4e5b32ea1ab..1141b236b2b50e760ed1689e5afc02e9ff09ea13 100644 (file)
@@ -4597,7 +4597,7 @@ CIM server listening on HTTPS port {0}."}
         */
         Pegasus.Common.SocketzOS_inline.WRONG_ROLE:string {"PGS12544E: ATTLS policy specifies the wrong HandshakeRole for the CIM Server HTTPS port. Communication not secured. Connection closed."}
 
-        
+
         /**
         * @note  PGS12567:
         *    Substitution {0} is a user name (a string)
@@ -4608,6 +4608,17 @@ CIM server listening on HTTPS port {0}."}
         */
         Pegasus.Common.SocketzOS_inline.NOREAD_CIMSERV_ACCESS:string {"PGS12567W: Request UserID {0} doesn't have READ permission to profile CIMSERV CL(WBEM)."}
 
+        /**
+        * @note PGS12568:
+        *    Do not translate ATTLS , CIM, TCP-IP and HTTPS.
+        */
+        Pegasus.Common.SocketzOS_inline.POLICY_OFF:string {"PGS12568E: ATTLS is not active for TCP-IP stack the CIM server is using for HTTPS connections. Communication not secured. Connection closed."}
+
+        /**
+        * @note PGS12569:
+        *    Do not translate "ATTLS policy" , CIM, TCP-IP and HTTPS.
+        */
+        Pegasus.Common.SocketzOS_inline.NO_POLICY:string {"PGS12569E: There is no ATTLS policy found for the CIM server HTTPS connections. Communication not secured. Connection closed."}
         
         // End z/OS messages