db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1639804 - in /db/derby/code/trunk/java/drda/org/apache/derby: impl/drda/NetworkServerControlImpl.java loc/drda/messages_en.properties
Date Fri, 14 Nov 2014 23:29:38 GMT
Author: mamta
Date: Fri Nov 14 23:29:37 2014
New Revision: 1639804

URL: http://svn.apache.org/r1639804
Log:
DERBY-6768(List the enabled protocols in derby.log for network server configuration)

With this change, we will now print the enabled protocols list in the log file when the server
starts up. A sample new line in the log will look as follows
 Wed Nov 12 21:32:21 PST 2014 : Apache Derby Network Server - 10.12.0.0 alpha - (1636020M)
Enabled Protocols are SSLv3, TLSv1, TLSv1.1, TLSv1.2



Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
    db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=1639804&r1=1639803&r2=1639804&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Fri Nov 14 23:29:37 2014
@@ -753,6 +753,25 @@ public final class NetworkServerControlI
         }
     }
     
+    /*
+     * DERBY-6768(List the enabled protocols in derby.log for network 
+     *  server configuration)
+     * Get the enabled protocols so we can list them in the log file
+     */
+    private String getEnabledProtocols(SSLServerSocket sslServerSocket) {
+    	//Converting the String array of enabled protocols to a String
+    	StringBuffer sbf = new StringBuffer();
+        String[] enabledProtocols = sslServerSocket.getEnabledProtocols();
+        if(enabledProtocols.length > 0){
+               
+                sbf.append(enabledProtocols[0]);
+                for(int i=1; i < enabledProtocols.length; i++){
+                        sbf.append(", ").append(enabledProtocols[i]);
+                }
+               
+        }
+        return sbf.toString();
+    }
 
     /**
      * Start a network server
@@ -822,11 +841,17 @@ public final class NetworkServerControlI
             break;
         case SSL_BASIC:
             consolePropertyMessage("DRDA_SSLReady.I", new String [] 
-                {Integer.toString(portNumber), att_srvclsnm, versionString});
+                    {Integer.toString(portNumber), att_srvclsnm, versionString});
+            consolePropertyMessage("DRDA_EnabledProtocols.I", new String [] 
+                    {getEnabledProtocols((SSLServerSocket) serverSocket), 
+            		att_srvclsnm, versionString});
             break;
         case SSL_PEER_AUTHENTICATION:
             consolePropertyMessage("DRDA_SSLClientAuthReady.I", new String [] 
                 {Integer.toString(portNumber), att_srvclsnm, versionString});
+            consolePropertyMessage("DRDA_EnabledProtocols.I", new String [] 
+                    {getEnabledProtocols((SSLServerSocket) serverSocket), 
+            		att_srvclsnm, versionString});
             break;
         }
 
@@ -1002,7 +1027,6 @@ public final class NetworkServerControlI
             ex.printStackTrace();
         }
     }
-    
     //Print the passed exception on the console and ignore it after that
     private void consolePrintAndIgnore(String msgProp, 
             Exception e, boolean printTimeStamp) {

Modified: db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties?rev=1639804&r1=1639803&r2=1639804&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties Fri Nov
14 23:29:37 2014
@@ -25,6 +25,7 @@ DRDA_NoInputStream.S=Could not get input
 DRDA_Ready.I={1} Network Server - {2} started and ready to accept connections on port {0}
 DRDA_SSLReady.I={1} Network Server - {2} started and ready to accept SSL connections on port
{0}
 DRDA_SSLClientAuthReady.I={1} Network Server - {2} started and ready to accept SSL connections
with client authentication on port {0} 
+DRDA_EnabledProtocols.I={1} Network Server - {2} Enabled Protocols are {0}
 DRDA_UnableToAccept.S=Unable to accept connections.
 DRDA_ConnNumber.I=Connection number: {0}.
 DRDA_ClientSocketError.S=Error on client socket:\n {0}



Mime
View raw message