Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ssl handshake failure #127

Open
arashthk opened this issue May 29, 2017 · 9 comments
Open

ssl handshake failure #127

arashthk opened this issue May 29, 2017 · 9 comments

Comments

@arashthk
Copy link

When receiving email from Yahoo I get this error message:

error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/s3_pkt.c:1493:SSL alert number 46
140050183874432:error:140940E5:SSL routines:ssl3_read_bytes:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1216:

    at Error (native)
events.js:165
      throw err;
      ^

Error: Uncaught, unspecified "error" event. (undefined)
    at Mailin.emit (events.js:163:17)
    at SMTPServer.<anonymous> (/home/arash/.npm-global/lib/node_modules/mailin/lib/mailin.js:519:15)
    at emitOne (events.js:96:13)
    at SMTPServer.emit (events.js:188:7)
    at SMTPServer._onError (/home/arash/.npm-global/lib/node_modules/mailin/node_modules/smtp-server/lib/smtp-server.js:237:10)
    at emitOne (events.js:96:13)
    at SMTPConnection.emit (events.js:188:7)
    at SMTPConnection._onError (/home/arash/.npm-global/lib/node_modules/mailin/node_modules/smtp-server/lib/smtp-connection.js:274:10)
    at emitOne (events.js:101:20)
    at TLSSocket.emit (events.js:188:7)
    at emitErrorNT (net.js:1277:8)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
warn: It is likely that an error caused Mailin to crash.
warn: Please report this to https://github.com/Flolagale/mailin/issues

Ubuntu 14.04
OpenSSL 1.0.2k 26 Jan 2017
mailin version: 3.0.4
certificates are updated (apt-get install ca-certificates)

@justin-haworth
Copy link

justin-haworth commented Oct 26, 2017

I am having this issue as well. We have a server setup to receive files from vendors and 1 vendor in South Africa can never send files because this error pops up and crashes the server every time. I hope that there is a fix for this soon.

@Kostanos
Copy link

Same issue here, any help please? the message appeared after upgrade to node 8.8.1

@Kostanos
Copy link

Kostanos commented Nov 3, 2017

Fixed the issue by adding valid (could be self signed) certificate to mailin config:

const options = {
    port: 25,
    disableWebhook: true,
    logFile: 'mailin.log,
    smtpOptions: {
        disableDNSValidation: true,
        disableDnsValidation: true,
        disableDkim: true,
        disableSpf: true,
        rejectUnauthorized: false,
        key: 'privkey.pem',
        cert: 'fullchain.pem',
    }
}
mailin.start(options);

My certificates are signed with LetsEncrypt. not sure if self signed would work, but should.

@justin-haworth
Copy link

I tried this using a .crt and .key files and had no luck. I do not know enough about the certs to fix whatever is broken in using them. The same files work just fine for the https for the app.

@justin-haworth
Copy link

okay just for anyone that might have tried @Kostanos solution to no avail, I do not know if he is using an older version of mailin, but I finally got his solution to work by removing the smtpOptions. in other words:

const options = {
port: 25,
disableWebhook: true,
logFile: 'mailin.log,
disableDNSValidation: true,
disableDnsValidation: true,
disableDkim: true,
disableSpf: true,
rejectUnauthorized: false,
key: 'privkey.pem',
cert: 'fullchain.pem'
}

hope this helps someone.

@Kostanos
Copy link

I'm using the latest version of mailin available - 3.0.4:

$ cat package-lock.json | grep mailin
    "mailin": {
      "resolved": "https://registry.npmjs.org/mailin/-/mailin-3.0.4.tgz",

I also found some code snippets using smtpOptions: https://github.com/Flolagale/mailin#embedded-inside-a-node-application

@justin-haworth
Copy link

justin-haworth commented Nov 21, 2017

I figured you were since your orig reply was so recent. I am also using the same version. For whatever reason, I had to change the options object. Figured it might help somebody else. Thanks for your reply.

@AdeelK93
Copy link

I feel like @Kostanos's config is right, since the option is originating from here, though I'm still having a bit of trouble getting my ssl emails routed right

@justin-haworth
Copy link

justin-haworth commented Dec 15, 2017

I have no doubt or argument that his config is correct. I just wanted to point out that, for whatever reason, I could get not my app to start with a config similar to that. I had to adjust the smtp options. Just wanted to share it in case anyone else was getting the same initial results I was. I have no idea what I was doing differently outside of this config. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants