# Smtp authentication

**URL:** <https://community.graylog.org/t/smtp-authentication/17248>\
**Category:** Graylog Central (peer support)\
**Created:** [September 22, 2020, 5:54am UTC](https://community.graylog.org/t/smtp-authentication/17248 "2020-09-22T05:54:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schurd](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/schurd/32/1068_2.png) [@schurd](https://community.graylog.org/u/schurd)\
**Post date:** [September 22, 2020, 5:54am UTC](https://community.graylog.org/t/smtp-authentication/17248/1 "2020-09-22T05:54:17Z")

</div>

Hello,  
I need to authenticate agains a smtp server to send emails. I get this error:

`> The Graylog server encountered an error while trying to send an email. This is the detailed error message: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtplb.int.it.gkvi:587 (javax.mail.MessagingException: Could not convert socket to TLS; nested exception is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target)`  
But the Java Keystore is defined with this:  
-Djavax.net.ssl.trustStore=/etc/graylog/server/cacerts.jks  
Is there another Java parameter I need to define?

Graylog is 3.3.5, Java is OpenJDK 1.8.0\_232.

Thanks in advance,

Dietmar

---

<div class="post-metadata">

**Author:** ![shoothub](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/shoothub/32/6412_2.png) [@shoothub](https://community.graylog.org/u/shoothub)\
**Post date:** [September 22, 2020, 7:24am UTC](https://community.graylog.org/t/smtp-authentication/17248/2 "2020-09-22T07:24:47Z")

</div>

1. Try to debug connection to SMTP server using SSLPoke.class  
[https://confluence.atlassian.com/kb/unable-to-connect-to-ssl-services-due-to-pkix-path-building-failed-error-779355358.html](https://confluence.atlassian.com/kb/unable-to-connect-to-ssl-services-due-to-pkix-path-building-failed-error-779355358.html)

2. Your java keystore files (cacerts.jks) should contain root CA certificate of your SMTP server. If you use also intermediate certificate, please also include it in keystore, so certifcate path is valid.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [October 6, 2020, 7:24am UTC](https://community.graylog.org/t/smtp-authentication/17248/3 "2020-10-06T07:24:49Z")

</div>

Closed on October 6, 2020, 7:24am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
