jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1684228 - in /jmeter/trunk: src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/protocol/SendMailCommand.java xdocs/changes.xml
Date Mon, 08 Jun 2015 17:22:15 GMT
Author: fschumacher
Date: Mon Jun  8 17:22:15 2015
New Revision: 1684228

URL: http://svn.apache.org/r1684228
Log:
Bug 58013 - Enable all protocols that are enabled on the default SSLContext for usage with
the SMTP Sampler.

Bugzilla Id: 58013

Modified:
    jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/protocol/SendMailCommand.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/protocol/SendMailCommand.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/protocol/SendMailCommand.java?rev=1684228&r1=1684227&r2=1684228&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/protocol/SendMailCommand.java
(original)
+++ jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/protocol/SendMailCommand.java
Mon Jun  8 17:22:15 2015
@@ -39,8 +39,10 @@ import javax.mail.internet.InternetAddre
 import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMultipart;
+import javax.net.ssl.SSLContext;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.jmeter.config.Argument;
 import org.apache.jmeter.services.FileServer;
 import org.apache.jmeter.testelement.property.CollectionProperty;
@@ -137,6 +139,17 @@ public class SendMailCommand {
         props.setProperty("mail." + protocol + ".timeout", getTimeout());
         props.setProperty("mail." + protocol + ".connectiontimeout", getConnectionTimeout());
 
+        if (useStartTLS || useSSL) {
+            try {
+                String allProtocols = StringUtils.join(
+                    SSLContext.getDefault().getSupportedSSLParameters().getProtocols(), "
");
+                logger.info("Use ssl/tls protocols for mail: " + allProtocols);
+                props.setProperty("mail.smtp.ssl.protocols", allProtocols);
+            } catch (Exception e) {
+                logger.error("Problem setting ssl/tls protocols for mail", e);
+            }
+        }
+
         if (enableDebug) {
             props.setProperty("mail.debug","true");
         }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1684228&r1=1684227&r2=1684228&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Mon Jun  8 17:22:15 2015
@@ -132,6 +132,7 @@ Summary
 
 <h3>Other Samplers</h3>
 <ul>
+    <li><bug>58013</bug>Enable all protocols that are enabled on the default
SSLContext for usage with the SMTP Sampler.</li>
 </ul>
 
 <h3>Controllers</h3>



Mime
View raw message