geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r672790 - in /geronimo/javamail/trunk/geronimo-javamail_1.4: ./ geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/smtp/ geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/util/
Date Mon, 30 Jun 2008 15:07:01 GMT
Author: rickmcguire
Date: Mon Jun 30 08:07:00 2008
New Revision: 672790

URL: http://svn.apache.org/viewvc?rev=672790&view=rev
Log:
GERONIMO-4172 Add support for the mail.<protocol>.ssl.protocols and mail.<protocol>.ssl.ciphersuites
properties. 


Modified:
    geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/smtp/SMTPTransport.java
    geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/util/MailConnection.java
    geronimo/javamail/trunk/geronimo-javamail_1.4/pom.xml

Modified: geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/smtp/SMTPTransport.java
URL: http://svn.apache.org/viewvc/geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/smtp/SMTPTransport.java?rev=672790&r1=672789&r2=672790&view=diff
==============================================================================
--- geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/smtp/SMTPTransport.java
(original)
+++ geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/smtp/SMTPTransport.java
Mon Jun 30 08:07:00 2008
@@ -142,6 +142,10 @@
     protected static final String MAIL_SMTP_ENCODE_TRACE = "encodetrace";
     
     protected static final String MAIL_SMTP_ALLOW8BITMIME = "allow8bitmime";
+    
+    protected static final String MAIL_SMTP_SSL_PROTOCOLS = "ssl.protocols"; 
+    
+    protected static final String MAIL_SMTP_SSL_CIPHERSUITES = "ssl.ciphersuites"; 
 
     protected static final int MIN_MILLIS = 1000 * 60;
 
@@ -1321,6 +1325,33 @@
         if (timeout >= 0) {
             socket.setSoTimeout(timeout);
         }
+        
+        // if there is a list of protocols specified, we need to break this down into 
+        // the individual names 
+        String protocols = getProtocolProperty(MAIL_SMTP_SSL_PROTOCOLS); 
+        if (protocols != null) {
+            ArrayList<String> list = new ArrayList<String>(); 
+            StringTokenizer t = new StringTokenizer(protocols); 
+            
+            while (t.hasMoreTokens()) {
+                list.add(t.nextToken()); 
+            }
+            
+            ((SSLSocket)socket).setEnabledProtocols(list.toArray(new String[list.size()]));

+        }
+        
+        // and do the same for any cipher suites 
+        String suites = getProtocolProperty(MAIL_SMTP_SSL_CIPHERSUITES); 
+        if (suites != null) {
+            ArrayList<String> list = new ArrayList<String>(); 
+            StringTokenizer t = new StringTokenizer(suites); 
+            
+            while (t.hasMoreTokens()) {
+                list.add(t.nextToken()); 
+            }
+            
+            ((SSLSocket)socket).setEnabledCipherSuites(list.toArray(new String[list.size()]));

+        }
     }
 
     /**

Modified: geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/util/MailConnection.java
URL: http://svn.apache.org/viewvc/geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/util/MailConnection.java?rev=672790&r1=672789&r2=672790&view=diff
==============================================================================
--- geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/util/MailConnection.java
(original)
+++ geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/util/MailConnection.java
Mon Jun 30 08:07:00 2008
@@ -76,6 +76,8 @@
     protected static final String MAIL_SSL_FACTORY_CLASS = "SSLsocketFactory.class";
     protected static final String MAIL_SSL_FACTORY_FALLBACK = "SSLsocketFactory.fallback";
     protected static final String MAIL_SSL_FACTORY_PORT = "SSLsocketFactory.port";
+    protected static final String MAIL_SSL_PROTOCOLS = "ssl.protocols";
+    protected static final String MAIL_SSL_CIPHERSUITES = "ssl.ciphersuites";
     protected static final String MAIL_LOCALADDRESS = "localaddress";
     protected static final String MAIL_LOCALPORT = "localport";
     protected static final String MAIL_ENCODE_TRACE = "encodetrace";
@@ -413,6 +415,33 @@
         if (timeout >= 0) {
             socket.setSoTimeout(timeout);
         }
+        
+        // if there is a list of protocols specified, we need to break this down into 
+        // the individual names 
+        String protocols = props.getProperty(MAIL_SSL_PROTOCOLS); 
+        if (protocols != null) {
+            ArrayList<String> list = new ArrayList<String>(); 
+            StringTokenizer t = new StringTokenizer(protocols); 
+            
+            while (t.hasMoreTokens()) {
+                list.add(t.nextToken()); 
+            }
+            
+            ((SSLSocket)socket).setEnabledProtocols(list.toArray(new String[list.size()]));

+        }
+        
+        // and do the same for any cipher suites 
+        String suites = props.getProperty(MAIL_SSL_CIPHERSUITES); 
+        if (suites != null) {
+            ArrayList<String> list = new ArrayList<String>(); 
+            StringTokenizer t = new StringTokenizer(suites); 
+            
+            while (t.hasMoreTokens()) {
+                list.add(t.nextToken()); 
+            }
+            
+            ((SSLSocket)socket).setEnabledCipherSuites(list.toArray(new String[list.size()]));

+        }
     }
 
 

Modified: geronimo/javamail/trunk/geronimo-javamail_1.4/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/javamail/trunk/geronimo-javamail_1.4/pom.xml?rev=672790&r1=672789&r2=672790&view=diff
==============================================================================
--- geronimo/javamail/trunk/geronimo-javamail_1.4/pom.xml (original)
+++ geronimo/javamail/trunk/geronimo-javamail_1.4/pom.xml Mon Jun 30 08:07:00 2008
@@ -134,8 +134,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.4</source>
-                    <target>1.4</target>
+                    <source>1.5</source>
+                    <target>1.5</target>
                 </configuration>
             </plugin>
 



Mime
View raw message