node-imap
node-imap copied to clipboard
Can't connect to Exchange imap
var config = {
imap: {
user: '[email protected]',
password: ';hs1\\:QNLrwg`wFW6Z6:',
host: 'mail.renins.com',
port: 993,
tls: true,
tlsOptions: {'servername': 'ren-mskexchmb03.mos.renins.com'},
authTimeout: 3000
}
};
Error: unable to verify the first certificate
What I do wrong?
Either someone is trying to MITM your connection or the server is actually providing a self-signed certificate. If it's the latter, you will need to make sure the certificate's CA is used by node. There are multiple ways of doing that, such as adding to and using the OS-wide OpenSSL certificate store with node (--use-openssl-ca) or programmatically referencing the CA to use for the connection via the ca option in tlsOptions.