Revision 62430
Added by Konstantinos Triantafyllou over 1 year ago
modules/uoa-user-management/trunk/src/main/java/eu/dnetlib/openaire/user/utils/EmailSender.java | ||
---|---|---|
18 | 18 |
private String port; |
19 | 19 |
private String from; |
20 | 20 |
private String auth; |
21 |
private String sslProtocols; |
|
21 | 22 |
|
22 | 23 |
Logger logger = Logger.getLogger(EmailSender.class); |
23 | 24 |
|
... | ... | |
29 | 30 |
properties.put("mail.smtp.host", host); |
30 | 31 |
properties.put("mail.smtp.port", port); |
31 | 32 |
properties.put("mail.smtp.auth", auth); |
32 |
properties.put("mail.smtp.ssl.protocols", "TLSv1.2"); |
|
33 | 33 |
properties.put("mail.smtp.starttls.enable", "true"); |
34 |
properties.put("mail.smtp.ssl.trust", "*"); |
|
34 |
if(sslProtocols != null) { |
|
35 |
properties.put("mail.smtp.ssl.protocols", sslProtocols); |
|
36 |
} |
|
35 | 37 |
Session session = javax.mail.Session.getInstance(properties, |
36 | 38 |
new Authenticator() { |
37 | 39 |
protected PasswordAuthentication getPasswordAuthentication() { |
... | ... | |
110 | 112 |
this.auth = auth; |
111 | 113 |
} |
112 | 114 |
|
115 |
public String getSslProtocols() { |
|
116 |
return sslProtocols; |
|
117 |
} |
|
118 |
|
|
119 |
public void setSslProtocols(String sslProtocols) { |
|
120 |
this.sslProtocols = sslProtocols; |
|
121 |
} |
|
113 | 122 |
} |
modules/uoa-user-management/trunk/src/main/resources/eu/dnetlib/openaire/user/springContext-userManagementService.xml | ||
---|---|---|
27 | 27 |
<property name="port" value="${mail.smtp.port}" /> |
28 | 28 |
<property name="from" value="${mail.smtp.from}" /> |
29 | 29 |
<property name="auth" value="${mail.smtp.auth}" /> |
30 |
<property name="sslProtocols" value="${mail.smtp.sslProtocols:null}" /> |
|
30 | 31 |
</bean> |
31 | 32 |
|
32 | 33 |
<bean id="mUserActionsLDAP" class="eu.dnetlib.openaire.user.ldap.MUserActionsLDAP"/> |
Also available in: Unified diff
Add property for ssl protocols