question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Self signed certificate

See original GitHub 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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
pavel-omelchukcommented, Mar 30, 2020

@ctobtb If you need a fast and rough solution, that may help: process.env.NODE_TLS_REJECT_UNAUTHORIZED='0';

1reaction
MarcoCatalancommented, Apr 8, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Self-signed certificate - Wikipedia
In cryptography and computer security, self-signed certificates are public key certificates that are not issued by a certificate authority (CA).
Read more >
What is a Self-Signed Certificate? Advantages, Risks ...
Another strategy is to issue self-signed SSL certificates. A self-signed certificate is one that is not signed by a CA at all –...
Read more >
Creating a Self-Signed SSL Certificate - Heroku Dev Center
Create a self-signed SSL certificate as a quick and inexpensive way to add SSL encryption to non-production applications or apps with ...
Read more >
What Is A Self-Signed SSL Certificate? | Sectigo® Official
A self-signed SSL certificate is a digital certificate that's not signed by a publicly trusted Certificate Authority (CA).
Read more >
Generating a self-signed certificate using OpenSSL - IBM
To generate a self-signed SSL certificate using the OpenSSL, complete the following steps: ... Run the following OpenSSL command to generate your private...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found