Skip to content

Commit

Permalink
use TLSv1.2 by default (requires javax.mail upgrade) (#982)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Zipay <mzipay@sysintspec.com>
mzipay and Matthew Zipay authored Jul 13, 2021
1 parent 4797374 commit 10d6358
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metl-assemble/gradle.properties
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ commonsNetVersion=3.5
httpComponentsVersion=4.3.2
jaxenVersion=1.1.4
jacksonVersion=2.8.1
javaMailVersion=1.4.7
javaMailVersion=1.6.2
jdomVersion=2.0.5
jt400Version=8.4
symmetricVersion=3.9.10
2 changes: 1 addition & 1 deletion metl-core/build.gradle
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ dependencies {
compile "commons-io:commons-io:$commonsIoVersion"
compile "commons-net:commons-net:$commonsNetVersion"
compile "jaxen:jaxen:$jaxenVersion"
compile "javax.mail:mail:$javaMailVersion"
compile "javax.mail:javax.mail-api:$javaMailVersion"
compile "org.jdom:jdom2:$jdomVersion"
compile "javax.el:javax.el-api:3.0.0"
compile "com.h2database:h2:$h2Version"
Original file line number Diff line number Diff line change
@@ -43,7 +43,9 @@ public class MailSession {
public static final String SETTING_PASSWORD = "mail.password";

public static final String SETTING_USE_TLS = "mail.smtp.starttls.enable";


public static final String SETTING_PROTOCOLS = "mail.smtp.ssl.protocols";

public static final String SETTING_USE_AUTH = "mail.smtp.auth";

Session session;
@@ -60,6 +62,7 @@ public MailSession(Map<String, String> globalSettings) {
prop.setProperty(SETTING_PORT_NUMBER, getGlobalSetting(SETTING_PORT_NUMBER, "25"));
prop.setProperty(SETTING_FROM, getGlobalSetting(SETTING_FROM, "metl@localhost"));
prop.setProperty(SETTING_USE_TLS, getGlobalSetting(SETTING_USE_TLS, "false"));
prop.setProperty(SETTING_PROTOCOLS, getGlobalSetting(SETTING_PROTOCOLS, "TLSv1.2"));
prop.setProperty(SETTING_USE_AUTH, getGlobalSetting(SETTING_USE_AUTH, "false"));

session = Session.getInstance(prop);

0 comments on commit 10d6358

Please sign in to comment.