manusa / mnIMAPSync

Java IMAP email syncing tool
Apache License 2.0
37 stars 13 forks source link

SSL sync error #39

Open edmundlaugasson opened 2 years ago

edmundlaugasson commented 2 years ago

used latest 0.0.3 version of mnIMAPSync with different Java versions OpenJDK 17; Oracle JRE 17 and 8: java -jar mnIMAPSync.jar --host1 imap.gmail.com --port1 993 --user1 user@gmail.com --password1 password --ssl1 --host2 other.server.com --port2 993 --user2 user2@other.server.com --password2 password2 --ssl2

Without SSL it starts but no sync follows and numbers remain as zero.

Error message:

SEVERE: null
javax.mail.MessagingException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate);
  nested exception is:
        javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
        at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:618)
        at javax.mail.Service.connect(Service.java:291)
        at com.marcnuri.mnimapsync.MNIMAPSync.openStore(MNIMAPSync.java:271)
        at com.marcnuri.mnimapsync.MNIMAPSync.sync(MNIMAPSync.java:89)
        at com.marcnuri.mnimapsync.MNIMAPSync.main(MNIMAPSync.java:147)
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
        at sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:171)
        at sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:106)
        at sun.security.ssl.TransportContext.kickstart(TransportContext.java:238)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:394)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373)
        at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:503)
        at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:234)
        at com.sun.mail.iap.Protocol.<init>(Protocol.java:109)
        at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:104)
        at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:585)
        ... 4 more
Tudor44 commented 1 year ago

Hello @edmundlaugasson ,

I compiled from source using gradle and seems that with newer version of JDKs doesn't work. It requires gradle < 7 and JDK 8 for build the project.

I m preparing a pull request for add a new functionality for extract the parameters for sync with a properties file.