Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ public abstract class Email {

/**
* If set to true, check the server identity as specified by RFC 2595. These additional checks based on the content of the server's certificate are intended
* to prevent man-in-the-middle attacks. Defaults to false.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I fix this?

* to prevent man-in-the-middle attacks. Defaults to true.
*/
private boolean sslCheckServerIdentity;
private boolean sslCheckServerIdentity = true;

/**
* If set to true, and a message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a
Expand Down Expand Up @@ -830,8 +830,8 @@ public Session getMailSession() throws EmailException {
properties.setProperty(EmailConstants.MAIL_SMTP_SOCKET_FACTORY_FALLBACK, "false");
}

if ((isSSLOnConnect() || isStartTLSEnabled()) && isSSLCheckServerIdentity()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on with this?

properties.setProperty(EmailConstants.MAIL_SMTP_SSL_CHECKSERVERIDENTITY, "true");
if (isSSLOnConnect() || isStartTLSEnabled()) {
properties.setProperty(EmailConstants.MAIL_SMTP_SSL_CHECKSERVERIDENTITY, String.valueOf(isSSLCheckServerIdentity()));
}

if (bounceAddress != null) {
Expand Down