You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by ri...@apache.org on 2007/01/25 22:37:27 UTC

svn commit: r500002 - /incubator/openejb/trunk/openejb2/modules/openejb-yoko/src/main/java/org/apache/openejb/yoko/SocketFactory.java

Author: rickmcguire
Date: Thu Jan 25 13:37:26 2007
New Revision: 500002

URL: http://svn.apache.org/viewvc?view=rev&rev=500002
Log:
OPENEJB-460 Rules for SSL client transport selection need refinement.

The problem was actually simpler than I originally reported.  The client 
config in question did not have the properly SSL cert configuration.  There
were still a couple tweaks required in the target port selection code. 


Modified:
    incubator/openejb/trunk/openejb2/modules/openejb-yoko/src/main/java/org/apache/openejb/yoko/SocketFactory.java

Modified: incubator/openejb/trunk/openejb2/modules/openejb-yoko/src/main/java/org/apache/openejb/yoko/SocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-yoko/src/main/java/org/apache/openejb/yoko/SocketFactory.java?view=diff&rev=500002&r1=500001&r2=500002
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-yoko/src/main/java/org/apache/openejb/yoko/SocketFactory.java (original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-yoko/src/main/java/org/apache/openejb/yoko/SocketFactory.java Thu Jan 25 13:37:26 2007
@@ -227,23 +227,22 @@
                                     int supports = transportConfig.getSupports();
                                     int requires = transportConfig.getRequires();
                                     // override the port and hostname with what's configured here. 
-                                    port = transportConfig.getPort(); 
-                                    host = transportConfig.getHostname(); 
+                                    int sslPort = transportConfig.getPort(); 
+                                    String sslHost = transportConfig.getHostname(); 
 
                                     if (log.isDebugEnabled()) {
-
-                                        log.debug("IOR from target " + address.getHostName() + ":" + port);
+                                        log.debug("IOR from target " + sslHost + ":" + sslPort);
                                         log.debug("   SUPPORTS: " + ConfigUtil.flags(supports));
                                         log.debug("   REQUIRES: " + ConfigUtil.flags(requires));
                                     }
 
                                     // TLS is configured.  If this is explicitly noprotection, then
                                     // just go create a plain socket using the configured port. 
-                                    if (port >= 0 && (NoProtection.value & requires) == NoProtection.value) {
+                                    if ((NoProtection.value & requires) == NoProtection.value) {
                                         break;
                                     }
                                     // we need SSL, so create an SSLSocket for this connection.
-                                    return createSSLSocket(host, port, supports, requires);
+                                    return createSSLSocket(sslHost, sslPort, supports, requires);
                                 }
                             }
                         } catch (Exception e) {