Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add an option to skip SSL certificate validation when connecting to SSL-aware mail server #48

Closed
lospejos opened this issue Jul 11, 2016 · 5 comments

Comments

@lospejos
Copy link

Would be nice to add an option to skip SSL certificate validation when connecting to SSL-aware mail server which has selfsigned or unvalidatable certificate

@bbottema
Copy link
Owner

I will add it, but just so you know you can already add it:

Properties props = new Properties();
props.setProperty("mail.smtp.ssl.trust", "*");
mailer.applyProperties(props);

Or:

mailer.getSession().getProperties().put("mail.smtp.ssl.trust", "*");

@bbottema
Copy link
Owner

bbottema commented Jul 22, 2016

With the next release you can set the property programmatically, like so:

mailer.trustAllSSLHosts(true);
mailer.trustAllSSLHosts(false);

mailer.trustSSLHosts("a", "b", "c", ...);

@bbottema
Copy link
Owner

Released in v4.1.0.

@bbottema
Copy link
Owner

Bug #110 was fixed for this feature in 5.0.0.rc1-SNAPSHOT.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants