Comments (6)
I've worked around it by doing this:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
DO NOT DO THIS!
If you have a custom domain, please use proper certificates via letsencrypt. If this is for testing, please generate a trusted certificate via mkcert!
from emailjs-imap-client.
Dug into the code, this is not actually related to this repository, it's coming from the node socket library.
Looks like there is some confusion with the cert we are using, it's accepted by other code and libraries on other platforms and clients, just not by the node socket.
Since this is an internal facing only application I've worked around it by doing this:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
Which temporarily overrides and allows it to work with our faulty cert.
This is entirely unsafe to do in most other circumstances, more info here: http://stackoverflow.com/questions/31673587/error-unable-to-verify-the-first-certificate-in-nodejs
from emailjs-imap-client.
Same here on NODE.JS connecting to our own remote mail server, porting code from C# to javascript, C# code and IMAP settings work fine with server but not in Javascript with this library.
Some kind of cert issue but not sure what it could be, the client doesn't need a cert or knowledge of the cert normally and the mail server works fine with C# code directly, also a variety of mail clients on a variety of platforms so it's something I'm doing or in this library, any help appreciated.
Here is my test code:
var HOST = "mail.REDACTED.com";
var PORT = 993;
var OPTIONS = {
useSecureTransport: true,
auth: {
user: '[email protected]',
pass: 'REDACTED'
},
id: { name: 'REDACTED', version: '1.x' }
};
var client = new ImapClient(HOST, PORT, OPTIONS);
client.onerror = function (error) {
return {
error: 1,
msg: 'Error @ key-requests->fetchRequests->onError (some kind of IMAP related error, see error_detail)',
error_detail: error
}
}
client.connect().then(() => {
/* ready to roll */
client.listMailboxes().then((mailboxes) => {
//do something with mailboxes
client.logout().then(() => {
/* connection terminated */
client.close().then(() => {
/* connection terminated */
callback({
test: 1,
ok: 1,
STUB_RESULT: 1
})
});
});
})
});
[DEBUG][2017-03-09T23:37:07.920Z][1] Connecting to mail.REDACTED.com : 993
[DEBUG][2017-03-09T23:37:07.924Z][1] Entering state: 1
[ERROR][2017-03-09T23:37:12.510Z][1] Could not connect to server Error: Could not open socket: unable to verify the first certificate
[DEBUG][2017-03-09T23:37:12.510Z][1] Entering state: 5
[DEBUG][2017-03-09T23:37:12.510Z][1] Closing connection...
from emailjs-imap-client.
Forgot about this thread, closing
from emailjs-imap-client.
Dug into the code, this is not actually related to this repository, it's coming from the node socket library.
Looks like there is some confusion with the cert we are using, it's accepted by other code and libraries on other platforms and clients, just not by the node socket.
Since this is an internal facing only application I've worked around it by doing this:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
Which temporarily overrides and allows it to work with our faulty cert.This is entirely unsafe to do in most other circumstances, more info here: http://stackoverflow.com/questions/31673587/error-unable-to-verify-the-first-certificate-in-nodejs
Great solution man, it works!!!
from emailjs-imap-client.
I've worked around it by doing this:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";DO NOT DO THIS!
If you have a custom domain, please use proper certificates via letsencrypt. If this is for testing, please generate a trusted certificate via mkcert!
Thanks, ill check it out. Like others, im having problems with IMAP connect. This problems started today out of nowhere, it worked for more than 2 weeks.
from emailjs-imap-client.
Related Issues (20)
- how to get new messages first on listMessages? HOT 1
- UnhandledPromiseRejectionWarning: Error: IDLE not allowed now HOT 3
- How to Listen for new emails
- An in-range update of webpack-cli is breaking the build 🚨 HOT 2
- getaddrinfo ENOTFOUND imap.cox.net HOT 3
- emailjs problem with async methods
- How can I get from all messages the attachments?
- An in-range update of pako is breaking the build 🚨 HOT 2
- Can't remove, add or set \Seen
- Self signed certificate HOT 8
- No envelope HOT 1
- How to add other parameters
- _tls2.default.connect and help wanted
- Helping
- 8bit support HOT 1
- emailjs.org website not available
- UID passed in and UID received are not equal HOT 1
- Feature: Search for multiple HEADER fields (AND)
- Please update NPM package HOT 2
- Stop condition for arriving packets is not sufficient.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emailjs-imap-client.