-
Notifications
You must be signed in to change notification settings - Fork 123
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
Self signed certificate #233
Comments
@cecilcosta Have you enable "Less Secured App Access" on the Gmail account you're testing your code? |
@ctobtb YEs, it was enabled. Actually, it was working with imap, and simple imap adding the option |
@ctobtb If you need a fast and rough solution, that may help: |
@cecilcosta Take a look at this: nodejs/node#28167 |
It clearly has to do with how Node handles the opening of the Socket. I moved from Node12 to Node10 and I did not encounter this problem anymore. I know it is not a fix but maybe helpful. |
This has already been fixed in |
Are there any recent fix or production level workaround for this issue (NODE_TLS_REJECT_UNAUTHORIZED env variable seems like not a good practice at production)? @stellarhoof suggested a PR to provide tlsOptions with servername parameter. And seems like it would work. |
Here I go with the same issue... |
Whenever I try to connect to Google's IMAP it fails due to a self-signed certificate
[DEBUG][2020-03-08T15:37:16.582Z][1][taitor46][imap.gmail.com] Connecting to imap.gmail.com : 993 [DEBUG][2020-03-08T15:37:16.587Z][1][taitor46][imap.gmail.com] Entering state: 1 (node:38836) UnhandledPromiseRejectionWarning: Error: Could not open socket: self signed certificate at TCPSocket.socket.onerror (/Users/tutorspace/Workspace/emailtest/node_modules/emailjs-imap-client/dist/imap.js:161:16) at TCPSocket._emit (/Users/tutorspace/Workspace/emailtest/node_modules/emailjs-tcp-socket/dist/node-socket.js:100:32) at TLSSocket.<anonymous> (/Users/tutorspace/Workspace/emailtest/node_modules/emailjs-tcp-socket/dist/node-socket.js:74:18) at TLSSocket.emit (events.js:311:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21)
I had a similar issue when using
imap-simple
and it seems that we had to specify the host name.tlsOptions: { servername: 'imap.gmail.com' }
Such option doesn't seem to exist here (at least I couldn't find it).
Can you please check it? Testing with a gmail account is very straight away.
The text was updated successfully, but these errors were encountered: