node-imap icon indicating copy to clipboard operation
node-imap copied to clipboard

Can't connect to Exchange imap

Open sergeymurashow opened this issue 5 years ago • 1 comments

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?

sergeymurashow avatar Jun 17 '20 10:06 sergeymurashow

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.

mscdex avatar Jun 18 '20 03:06 mscdex