ditesh / node-poplib

POP3 client library for Node.js
MIT License
128 stars 44 forks source link

Unhandled Exception When the listening server is an IMAP server #20

Open khalilTN opened 9 years ago

khalilTN commented 9 years ago

I'm developing an adapter for emails independent from protocol, As mistake, i tried to connect pop3 client to an IMAP server, the connection is established and then when executing stls(), and exception occurs. My problem is that i can't handle this exception as it does not arrive to my app layer. A simple try catch cant solve the problem.

events.js:72

throw er; // Unhandled 'error' event
              ^
Error: 139645880629312:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:766:

    at SlabBuffer.use (tls.js:234:18)
    at CleartextStream.read [as _read] (tls.js:454:29)
    at CleartextStream.Readable.read (_stream_readable.js:340:10)
    at EncryptedStream.write [as _write] (tls.js:368:25)
    at doWrite (_stream_writable.js:225:10)
    at writeOrBuffer (_stream_writable.js:215:5)
    at EncryptedStream.Writable.write (_stream_writable.js:182:11)
    at Socket.ondata (stream.js:51:26)
    at Socket.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:764:14)