javax.mail.MessagingException: Remote host closed connection during handshake;
nested exception is:
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPSt ore.java:670)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at GetEmailMessage.riceviEmail(GetEmailMessage.java:4 0)
at a.main(a.java:5)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHands hake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unkn own Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unkn own Source)
at com.sun.mail.util.SocketFetcher.configureSSLSocket (SocketFetcher.java:549)
at com.sun.mail.util.SocketFetcher.createSocket(Socke tFetcher.java:354)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFe tcher.java:237)
at com.sun.mail.iap.Protocol.<init>(Protocol.java:116 )
at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMA PProtocol.java:115)
at com.sun.mail.imap.IMAPStore.newIMAPProtocol(IMAPSt ore.java:685)
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPSt ore.java:636)
... 4 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(Unknown Source)
... 15 more
Exception in thread "main" java.lang.IllegalStateException: Not connected
at com.sun.mail.imap.IMAPStore.checkConnected(IMAPSto re.java:1733)
at com.sun.mail.imap.IMAPStore.getFolder(IMAPStore.ja va:1528)
at GetEmailMessage.riceviEmail(GetEmailMessage.java:5 0)
at a.main(a.java:5)