I am trying to connect to an SMTP server using TLS to no avail.I am trying to replicate the following using node: `openssl s_client -crlf -starttls smtp -connect smtp.gmail.com:587`I've tried a multitude of different options and parameters but can't seem to get passed the following error:`Error: 139731603597184:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:252:`The following code works through port `465` (SMTPS) but I'm looking to connect via ``587`` (TLS/submission):const tls = require('tls'),port = 465,hostname = 'smtp.gmail.com';const options = {port: port,host: hostname};const socket = tls.connect(options);socket.setEncoding('utf8');socket.on('data', (data) => {console.log(\\Server: ${data}\);});socket.on('error', (err) => {console.log(\\Error: ${err}\);});socket.on('end', () => {console.log("End connection");});Am I missing an option in the tls section of the docs that is causing this error? Any help would be appreciated!
Submitted September 06, 2018 at 09:41AM by eNzyy
No comments:
Post a Comment