Graylog - Send alerts using SSL + TLS


(berekese) #1

Is it possible send alerts by email using that? I have to sign auto certificate but this isn’t possible because I dont know how do it.

Log:

Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
        at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710) ~[?:1.8.0_131]
        at sun.security.ssl.InputRecord.read(InputRecord.java:527) ~[?:1.8.0_131]
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) ~[?:1.8.0_131]
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) ~[?:1.8.0_131]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) ~[?:1.8.0_131]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) ~[?:1.8.0_131]
        at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:543) ~[graylog.jar:?]
        at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:348) ~[graylog.jar:?]
        at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:215) ~[graylog.jar:?]
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2019) ~[graylog.jar:?]
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697) ~[graylog.jar:?]
        at javax.mail.Service.connect(Service.java:386) ~[graylog.jar:?]
        at javax.mail.Service.connect(Service.java:245) ~[graylog.jar:?]
        at javax.mail.Service.connect(Service.java:194) ~[graylog.jar:?]
        at javax.mail.Transport.send0(Transport.java:253) ~[graylog.jar:?]
        at javax.mail.Transport.send(Transport.java:124) ~[graylog.jar:?]
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1411) ~[graylog.jar:?]

Thanks.


(Jan Doberstein) #2

hej @berekese

did you read the documentation?


(berekese) #3

Hi,

Yes I saw it but I prefered do it easier. I am using a banahosting cpanel. I created an account there and I’m trying to use that details to send emails but… not luck
My config:

#Email transport
transport_email_enabled = true
transport_email_hostname = mail.DOMAIN
transport_email_port = 25
transport_email_auth_username = alertas@DOMAIN
transport_email_auth_password = PASSWORD
transport_email_subject_prefix = [graylog]
transport_email_from_email = alertas@DOMAIN

#Error graylog:

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 : mail.DOMAIN:25 (javax.mail.MessagingException: Could not connect to SMTP host: mail.DOMAIN, port: 25; nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?)

Test with telnet:

telnet mail.DOMAIN 25

Trying 107.6.184.51…
Connected to DOMAIN.
Escape character is ‘^]’.
220-sh-europe120.banahosting.com ESMTP Exim 4.89 #1 Thu, 08 Jun 2017 01:49:01 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.

Why is it asking for SSL?

Thanks!


(Jan Doberstein) #4

did you try with ssl/tls enabled in Graylog server.conf?


(berekese) #5

I was using bad port :slight_smile: 465…

Final config (for future members)

Email transport

transport_email_enabled = true
transport_email_hostname = mail.DOMAIN
transport_email_port = 465
transport_email_use_auth = true
transport_email_use_tls = true
transport_email_use_ssl = true
transport_email_auth_username = alertas@DOMAIN
transport_email_auth_password = PASSWORD
transport_email_subject_prefix = [graylog]
transport_email_from_email = alertas@DOMAIN

Thanks :slight_smile:


(system) #6

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