AquaMail Forum

English - Android => Bug reports => Topic started by: Patschi on October 23, 2014, 11:46:19 pm

Title: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Patschi on October 23, 2014, 11:46:19 pm
Hello,

since I disabled the complete support of SSLv3 on my mailserver, I'm unable to estabilish a connection to the mailserver. When I allow SSLv3 again, it's working fine as expected. I guess the app is trying if SSLv3 is possible and aborts continuing checking for a working connection, even if TLS is working. I attached a screenshot, which error is occuring.

Thank you for your help!

Regards,
Patrik
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Kostya Vasilyev on October 24, 2014, 01:38:24 am
Actually, recent versions of Aqua have a setting (in app settings, under Network) to blacklist SSLv3.

Is that the one you are talking about -- or about server side settings?

When you enable "SSL hardening" there and also enable "blacklist SSLv3", then the preferred protocol order is: TLSv1.2, TLSv1.1, TLS1 and that's it. No SSLv3.


Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: mikeone on October 24, 2014, 01:47:12 am
Please install the latest "stable" version 1.5.0.25
http://www.aqua-mail.com/download/AquaMail-market-1.5.0.25.apk

There is a (new) setting under Settings > network to blacklist Sslv3 protocol
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Patschi on October 24, 2014, 02:03:45 am
@Kostya: I've completely disabled SSLv3 support on the serverside, but when I do so, I can't check anymore my mails in AquaMail because of this error in the screenshot I posted before.
@mikeone: I'm currently on 1.5.1-24.2-dev. Also when enabling this setting, it still does not work. The same error as above.

I'm getting the following error message on the server, when I try to check mails on my phone:
Quote
Oct 24 00:03:15 mail dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=XXX.XXX.XXX.XXX, lip=XXX.XXX.XXX.XXX, TLS handshaking: SSL_accept() failed: error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Kostya Vasilyev on October 24, 2014, 02:36:34 am
With "SSL hardening" in Aqua enabled, it will use TLS if available at the server end (1, 1.1 or 1.2).

After changing "Blacklist SSLv3" you will need to restart the phone -- I'll fix that.

Please try toggling the "Harden SSL" and restarting the phone.

I got things to work that way, with this in dovecot's 10-ssl.conf

Quote
# SSL protocols to use
ssl_protocols = !SSLv2 !SSLv3

# SSL ciphers to use
#ssl_cipher_list = ALL:!LOW:!SSLv2:!SSLv3:!EXP:!aNULL

Looked like this:

Quote
Oct 24 02:33:20 li463-125 dovecot: imap-login: Login: user=<xxxxxx@aqua-mail.com>, method=CRAM-MD5, rip=xxxxxxx, lip=xxxxxxx, mpid=18217, TLS, session=<CUzNph4GeQA+Tj2I>

and this:

Quote
10-24 02:33:19.400 I/AquaMail(23427): [NETWRK.2173] Connection to [mail.aqua-mail.com:993, sslRelaxed] completed: mail.aqua-mail.com/xxxxx:993
10-24 02:33:19.410 I/AquaMail(23427): [NETWRK.2173] Buffer sizes: 524288 send, 1048576 receive
10-24 02:33:19.420 I/AquaMail(23427): [NETWRK.2173] Encryption: protocol TLSv1.2, cipher TLS_DHE_RSA_WITH_AES_256_CBC_SHA
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: mikeone on October 24, 2014, 09:18:22 am
@Kostya: I've completely disabled SSLv3 support on the serverside, but when I do so, I can't check anymore my mails in AquaMail because of this error in the screenshot I posted before.
@mikeone: I'm currently on 1.5.1-24.2-dev. Also when enabling this setting, it still does not work. The same error as above.

I'm getting the following error message on the server, when I try to check mails on my phone:
Quote
Oct 24 00:03:15 mail dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=XXX.XXX.XXX.XXX, lip=XXX.XXX.XXX.XXX, TLS handshaking: SSL_accept() failed: error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher

... okay.  Then please try it with the newest dev-build:
http://www.aqua-mail.com/download/AquaMail-market-1.5.1-25-dev5.apk
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Patschi on October 24, 2014, 09:25:34 am
It's really strange... As I wrote before, it only does not work, when I remove the SSLv3 support. When I enable SSLv3, AquaMail is working fine and is using TLSv1.2 without issues...  Can't understand why. A friend, which is also using AquaMail, has the exact same issue as me.

However, I'm trying the blacklist functionality in the next couple of hours and will report back.

I'm currently using the following Dovecot settings: (Maybe it needs some improvements, but first AquaMail should work)
Quote
ssl_protocols = !SSLv2 !SSLv3
ssl_cipher_list = ALL:!LOW:!ADH:!SSLv2:!SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:+HIGH:+MEDIUM

When I remove the bold marked SSLv3 and restart Dovecot, AquaMail is connecting. When I keep the SSLv3 in there, the error of the screenshot of my first post is showing up and is not connecting. I'm trying to retry it after I enabled the Debug mode - maybe there are more interesting messages, which could help to locate the problem.

Thanks for the help so far!
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Patschi on October 24, 2014, 10:32:59 am
Okay, tested it right now.

Rebooting the phone after blacklisting SSLv3 on AquaMail does not help.

I've enabled the debug settings to get some more informations about the error. And yeah, got some more detailed debug messages. The most interesting part is:
Quote from: AquaMailDebug
2014.10.24 08:19:01.730 +0200   AquaMail   [NETWRK.639] Connecting to [mail.domain.tld:143, tlsStrict]
2014.10.24 08:19:01.731 +0200   AquaMail   [NETWRK.639] Resolving address for mail.domain.tld
2014.10.24 08:19:02.180 +0200   AquaMail   [NETWRK.639] IPv4: mail.domain.tld/XXX.XXX.XXX.XXX
2014.10.24 08:19:02.184 +0200   AquaMail   [NETWRK.639] Trying: mail.domain.tld/XXX.XXX.XXX.XXX:143
2014.10.24 08:19:02.567 +0200   AquaMail   [NETWRK.639] Socket connection completed
2014.10.24 08:19:02.582 +0200   AquaMail   [NETWRK.639] Connection to [mail.domain.tld:143, tlsStrict] completed: mail.domain.tld/XXX.XXX.XXX.XXX:143, time = 0.85 sec
2014.10.24 08:19:02.586 +0200   AquaMail   [NETWRK.639] Buffer sizes: 20500 send, 87380 receive
2014.10.24 08:19:03.350 +0200   AquaMail   [IMAP.639] Server greeting: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED] Dovecot ready.
2014.10.24 08:19:03.351 +0200   AquaMail   [IMAP.639] Server is Dovecot
2014.10.24 08:19:03.352 +0200   AquaMail   [IMAP.639] Sending: kman1 CAPABILITY
2014.10.24 08:19:03.454 +0200   AquaMail   [IMAP.639] Pre-login capabilities: CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED
2014.10.24 08:19:03.456 +0200   AquaMail   [IMAP.639] Server supports ID
2014.10.24 08:19:03.459 +0200   AquaMail   [IMAP.639] Result for kman1: 0 Pre-login capabilities listed, post-login capabilities have more., traffic: 171 read, 18 write
2014.10.24 08:19:03.463 +0200   AquaMail   [IMAP.639] Sending: kman2 ID ("name" "AquaMail" "version" "1.5.1-24.3-dev3" "build" "2101855" "os" "Android")
2014.10.24 08:19:03.555 +0200   AquaMail   [IMAP.639] Result for kman2: 0 ID completed., traffic: 34 read, 91 write
2014.10.24 08:19:03.556 +0200   AquaMail   [IMAP.639] Sending: kman3 STARTTLS
2014.10.24 08:19:03.682 +0200   AquaMail   [IMAP.639] Result for kman3: 0 Begin TLS negotiation now., traffic: 37 read, 16 write
2014.10.24 08:19:03.686 +0200   AquaMail   [NETWRK.639] Request for startTls content://org.kman.AquaMail.data/accounts/1/in to [mail.domain.tld:143, tlsStrict]
2014.10.24 08:19:03.689 +0200   AquaMail   [NETWRK.639] Using strict STARTTLS factory
2014.10.24 08:19:03.864 +0200   AquaMail   [NETWRK.639] Reconnecting to [mail.domain.tld:143, tlsStrict]
2014.10.24 08:19:03.868 +0200   SSLHardening   Hardening reorder: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, SSL_RSA_WITH_NULL_MD5, SSL_RSA_WITH_NULL_SHA, TLS_ECDH_ECDSA_WITH_NULL_SHA, TLS_ECDH_RSA_WITH_NULL_SHA, TLS_ECDHE_ECDSA_WITH_NULL_SHA, TLS_ECDHE_RSA_WITH_NULL_SHA, SSL_DH_anon_WITH_RC4_128_MD5, TLS_DH_anon_WITH_AES_128_CBC_SHA, TLS_DH_anon_WITH_AES_256_CBC_SHA, SSL_DH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_WITH_DES_CBC_SHA, TLS_ECDH_anon_WITH_RC4_128_SHA, TLS_ECDH_anon_WITH_AES_128_CBC_SHA, TLS_ECDH_anon_WITH_AES_256_CBC_SHA, TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_EXPORT_WITH_RC4_40_MD5, SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_ECDH_anon_WITH_NULL_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV], [TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5], [SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA] -> [TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_NULL_MD5, SSL_RSA_WITH_NULL_SHA, TLS_ECDH_ECDSA_WITH_NULL_SHA, TLS_ECDH_RSA_WITH_NULL_SHA, TLS_ECDHE_ECDSA_WITH_NULL_SHA, TLS_ECDHE_RSA_WITH_NULL_SHA, SSL_DH_anon_WITH_RC4_128_MD5, TLS_DH_anon_WITH_AES_128_CBC_SHA, TLS_DH_anon_WITH_AES_256_CBC_SHA, SSL_DH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_WITH_DES_CBC_SHA, TLS_ECDH_anon_WITH_RC4_128_SHA, TLS_ECDH_anon_WITH_AES_128_CBC_SHA, TLS_ECDH_anon_WITH_AES_256_CBC_SHA, TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_EXPORT_WITH_RC4_40_MD5, SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_ECDH_anon_WITH_NULL_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
2014.10.24 08:19:03.870 +0200   SSLHardening   Hardening reorder: [SSLv3, TLSv1, TLSv1.1, TLSv1.2], [TLSv1.2, TLSv1.1, TLSv1, SSLv3], [SSLv3] -> [TLSv1.2, TLSv1.1, TLSv1]
2014.10.24 08:19:03.872 +0200   SSLHardening   Setting hardened ciphers: [TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_NULL_MD5, SSL_RSA_WITH_NULL_SHA, TLS_ECDH_ECDSA_WITH_NULL_SHA, TLS_ECDH_RSA_WITH_NULL_SHA, TLS_ECDHE_ECDSA_WITH_NULL_SHA, TLS_ECDHE_RSA_WITH_NULL_SHA, SSL_DH_anon_WITH_RC4_128_MD5, TLS_DH_anon_WITH_AES_128_CBC_SHA, TLS_DH_anon_WITH_AES_256_CBC_SHA, SSL_DH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_WITH_DES_CBC_SHA, TLS_ECDH_anon_WITH_RC4_128_SHA, TLS_ECDH_anon_WITH_AES_128_CBC_SHA, TLS_ECDH_anon_WITH_AES_256_CBC_SHA, TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_EXPORT_WITH_RC4_40_MD5, SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_ECDH_anon_WITH_NULL_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
2014.10.24 08:19:03.873 +0200   SSLHardening   Setting hardened protocols: [TLSv1.2, TLSv1.1, TLSv1]
2014.10.24 08:19:03.970 +0200   AquaMail   [NETWRK.639] Closing socket SSL socket over Socket[address=mail.domain.tld/XXX.XXX.XXX.XXX,port=143,localPort=46515]
2014.10.24 08:19:03.989 +0200   AquaMail   [NETWRK.639] ***** ERROR: Unable to reconnect to [mail.domain.tld:143, tlsStrict]
javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x791b7250: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x73142cf8:0x00000000)
   at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448)
   at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocketImpl.java:661)
   at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:632)
   at org.kman.AquaMail.net.MailSocketConnection.doReconnectImpl(MailSocketConnection.java:263)
   at org.kman.AquaMail.net.MailConnectionManager.startTls(MailConnectionManager.java:323)
   at org.kman.AquaMail.mail.imap.ImapTask.ensureStartTLS(ImapTask.java:78)
   at org.kman.AquaMail.mail.imap.ImapTask_ConnectLogin.ensureConnectLogin(ImapTask_ConnectLogin.java:79)
   at org.kman.AquaMail.mail.imap.ImapTask_ConnectLogin.ensureConnectLogin(ImapTask_ConnectLogin.java:30)
   at org.kman.AquaMail.mail.imap.ImapTask_Sync.process(ImapTask_Sync.java:198)
   at org.kman.AquaMail.core.MailTaskExecutor.onTask(MailTaskExecutor.java:438)
   at org.kman.AquaMail.core.MailTaskExecutor.run(MailTaskExecutor.java:401)
   at java.lang.Thread.run(Thread.java:841)
Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x791b7250: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x73142cf8:0x00000000)
   at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
   at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:405)
   ... 11 more

Last data:
kman3 STARTTLS
Result for kman3: 0 Begin TLS negotiation now.
Caused by:
javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x791b7250: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x73142cf8:0x00000000)
   at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
   at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:405)
   at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocketImpl.java:661)
   at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:632)
   at org.kman.AquaMail.net.MailSocketConnection.doReconnectImpl(MailSocketConnection.java:263)
   at org.kman.AquaMail.net.MailConnectionManager.startTls(MailConnectionManager.java:323)
   at org.kman.AquaMail.mail.imap.ImapTask.ensureStartTLS(ImapTask.java:78)
   at org.kman.AquaMail.mail.imap.ImapTask_ConnectLogin.ensureConnectLogin(ImapTask_ConnectLogin.java:79)
   at org.kman.AquaMail.mail.imap.ImapTask_ConnectLogin.ensureConnectLogin(ImapTask_ConnectLogin.java:30)
   at org.kman.AquaMail.mail.imap.ImapTask_Sync.process(ImapTask_Sync.java:198)
   at org.kman.AquaMail.core.MailTaskExecutor.onTask(MailTaskExecutor.java:438)
   at org.kman.AquaMail.core.MailTaskExecutor.run(MailTaskExecutor.java:401)
   at java.lang.Thread.run(Thread.java:841)

I really could imagine, that AquaMail is trying somehow to detect support of SSLv2/SSLv3 and is failing with that...
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Kostya Vasilyev on October 24, 2014, 01:13:50 pm
>>> AquaMail is trying somehow to detect support of SSLv2/SSLv3 and is failing with that

Reasonable conjecture, but no.

This line:

>>> Setting hardened protocols: [TLSv1.2, TLSv1.1, TLSv1]

Means that my code called sslSocket.setEnabledProtocols( array TLSv1.2, TLSv1.1, TLSv1 ):

http://developer.android.com/reference/javax/net/ssl/SSLSocket.html#setEnabledProtocols(java.lang.String[])

I just tried STARTTLS (strict) and STARTTLS (accept any) with my server. It worked.

What I think you're seeing is Android's system level SSL negotiation cache -- easy to enable, no way to disable... So I delete the cache files, but I think the system code loads them into memory.

Please try this:

1 - Aqua settings -> Network -> switch "SSL hardening" off and on
2 - Reboot the phone

The first step will delete those SSL cache files, and the second step will make sure that the already loaded ones won't be used.
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Patschi on October 24, 2014, 01:29:15 pm
Tried it right now, but sadly it's still not working. I don't have any ideas what I could try otherwise.
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Kostya Vasilyev on October 24, 2014, 03:39:29 pm
Yes, I see this too.

Adding !SSLv3 in Dovecot *ciphers* causes same error -- even when SSLv3 is explicitly turned off at the socket level on my side.

In K9 Mail too.

This works and uses TLSv1.2:

Quote
# SSL protocols to use
ssl_protocols = !SSLv2 !SSLv3

# SSL ciphers to use
#ssl_cipher_list = ALL:!LOW:!SSLv2:!SSLv3:!EXP:!aNULL

And achieves the goal of blocking SSLv3 at the server:

Quote
$ openssl s_client -starttls imap -crlf -connect mail.aqua-mail.com:143 -ssl3
CONNECTED(00000003)
140252064523936:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1260:SSL alert number 40
140252064523936:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:596:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 350 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : SSLv3
    Cipher    : 0000
    Session-ID:
    Session-ID-ctx:
    Master-Key:
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1414150578
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
---

It's interesting that explicitly using TLS 1.2 to connect, with openssl, still shows SSLv3 in the Dovecot log:

Quote
$ openssl s_client -starttls imap -crlf -connect mail.aqua-mail.com:143 -tls1_2
...
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : DHE-RSA-AES256-GCM-SHA384

Quote
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x10, ret=1: before/accept initialization [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: before/accept initialization [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2002, ret=-1: unknown state [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 read client hello A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 write server hello A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 write certificate A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 write key exchange A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 write server done A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 flush data [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2002, ret=-1: SSLv3 read client certificate A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2002, ret=-1: SSLv3 read client certificate A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 read client key exchange A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 read finished A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 write session ticket A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 write change cipher spec A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 write finished A [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2001, ret=1: SSLv3 flush data [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x20, ret=1: SSL negotiation finished successfully [x.y.z.w]
Oct 24 15:41:05 li463-125 dovecot: imap-login: Warning: SSL: where=0x2002, ret=1: SSL negotiation finished successfully [x.y.z.w]

But I don't know if it means anything.

Finally, this https://zmap.io/sslv3/servers.html#dovecot says that

"ssl_protocols = !SSLv2 !SSLv3" is for Dovecot 2.1+

and

"ssl_ciphers = ..." is for Dovecot 2.0

I'm running 1:2.1.7-7+deb7u1
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Patschi on October 24, 2014, 06:03:01 pm
I have the exact same Dovecot version as you (default Debian stable repository). So what does this exactly mean? Do you know any ways we could resolve this? I don't want to have SSLv3 still enabled at all.
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Kostya Vasilyev on October 24, 2014, 08:37:00 pm
I got it to work, please see my above message.
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Patschi on October 24, 2014, 08:55:17 pm
Oh, sorry! I didn't read your post good enough and replied to fast. I also tested it now again with the following configuration as I posted a few posts before, but without the SSLv3 entry:

ssl_protocols = !SSLv2 !SSLv3
ssl_cipher_list = ALL:!LOW:!ADH:!SSLv2:!SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:+HIGH:+MEDIUM

It really seems that SSLv3 is disabled anyway and the app is working fine. That's a bit strange. But good to know! :-)

Thanks for your help!
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Kostya Vasilyev on October 24, 2014, 11:12:45 pm
It really looks like something in system code -- "openssl s_client" can connect even when you have "!SSLv3" in "ssL_cipher_list" -- but neither Aqua nor K9 Mail can...

On the other hand, this configuration key is supposedly not necessary for Dovecot 2.1+, which is what we're both using (Debian 7.7) -- and it does the job with preventing SSLv3 connections.
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Calle on May 31, 2016, 11:04:17 pm
Hello,

sorry for posting in this old thread - but I have exactly the problem mentioned here.
My email provider changed the imap-server to dovecot and I cannot connect to it anymore with Aquamail V 1.6.1.5 and Android 4.4.2.

The errormessage is exactly the one given in posting #1.

I tried the network-settings about hardening ssl and blacklisting sslv3 with rebooting my device - without success.

This is dovecot-config:

# SSL protocols to use
ssl_protocols = !SSLv3 !SSLv2

# SSL ciphers to use
ssl_cipher_list = HIGH::!aNULL:!eNULL:!kRSA:!kPSK:!kSRP:!aDSS:!kECDH:!kDH:!MD5:!SHA1:!RC2:!RC4:!SEED:!IDEA:!DES:!3DES

# Prefer the server's order of ciphers over client's.
ssl_prefer_server_ciphers = yes


Btw: AquaMail under Android 6.0.1 and exactly the same config works fine.

Thanks for help,

Carsten
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Kostya Vasilyev on May 31, 2016, 11:18:41 pm
AquaMail is the same on both, but the list of supported ciphers differs by Android version.

https://developer.android.com/reference/javax/net/ssl/SSLSocket.html

You may want to run "open ssl ciphers <your cipherspec here>" on the server to see the actual list.

Or maybe use nmap with ssl-enum-ciphers for same purpose.

And then maybe you can enable logging in AquaMail (see below) and cross-check the cipher list which gets enabled.

PS - you've got a redundant ":" after "HIGH".

PPS - I've got no issues with AquaMail on a 4.4 device, with Aqua's "SSL hardening" on or off, and with Aqua's "do not use SSLv3" on or off.

My Dovecot SSL config:

Quote
# SSL protocols to use
ssl_protocols = !SSLv2 !SSLv3

# SSL ciphers to use
#ssl_cipher_list = ALL:!LOW:!SSLv2:!SSLv3:!EXP:!aNULL
ssl_cipher_list = kRSA+AES:!LOW:!SSLv2:!EXP:!aNULL

# DH
ssl_dh_parameters_length = 2048

As you can see, my cipher list is really of the "tinfoil hat" variety (EC ciphers are not enabled).
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Kostya Vasilyev on June 01, 2016, 12:53:46 am
$ openssl ciphers 'HIGH:!aNULL:!eNULL:!kRSA:!kPSK:!kSRP:!aDSS:!kECDH:!kDH:!MD5:!SHA1:!RC2:!RC4:!SEED:!IDEA:!DES:!3DES' | tr ':' '\n'
ECDHE-RSA-AES256-GCM-SHA384
ECDHE-ECDSA-AES256-GCM-SHA384
ECDHE-RSA-AES256-SHA384
ECDHE-ECDSA-AES256-SHA384
DHE-RSA-AES256-GCM-SHA384
DHE-RSA-AES256-SHA256
ECDHE-RSA-AES128-GCM-SHA256
ECDHE-ECDSA-AES128-GCM-SHA256
ECDHE-RSA-AES128-SHA256
ECDHE-ECDSA-AES128-SHA256
DHE-RSA-AES128-GCM-SHA256
DHE-RSA-AES128-SHA256


All your ciphers use SHA256 or SHA384.

And every cipher with SHA256 or SHA384 that I see here is API 20 or newer, which is 5.0.

https://developer.android.com/reference/javax/net/ssl/SSLSocket.html

Personally I'd go with kRSA+AES which would give you:

$ openssl ciphers 'kRSA+AES' | tr ':' '\n'
AES256-GCM-SHA384
AES256-SHA256
AES256-SHA
AES128-GCM-SHA256
AES128-SHA256
AES128-SHA


GCM for 5.0+ (256 is really excessive though) and non-GCM AES-SHA for lower versions.

PS - please don't mistake me for a computer security expert :)

Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Calle on June 01, 2016, 01:05:02 am
Hi Kostya,

thanks for your quick answer. I tried to get the informations you requested:

Output of nmap:
Quote
~ (calle@online) 508 > nmap --script ssl-enum-ciphers -p 143 shabang

Starting Nmap 7.12 (  ) at 2016-05-31 23:26 CEST
Nmap scan report for shabang (217.70.197.9)
Host is up (0.00047s latency).
rDNS record for 217.70.197.9: shabang.toppoint.de
PORT    STATE SERVICE
143/tcp open  imap
| ssl-enum-ciphers:
|   TLSv1.2:
|     ciphers:
|       TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (secp384r1) - A
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (secp384r1) - A
|       TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (dh 2048) - A
|       TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (dh 2048) - A
|       TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (secp384r1) - A
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (secp384r1) - A
|       TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (dh 2048) - A
|       TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (dh 2048) - A
|     compressors:
|       NULL
|     cipher preference: server
|     warnings:
|       Key exchange parameters of lower strength than certificate key
|_  least strength: A

Output of AquaMail logging - while manually configure and test accout:

Quote
*
* New log file session: 2016.05.31 23:30:52.627 +0200
* Package: org.kman.AquaMail 1.6.1.5 (26000005)
* Process: pid 14366, elapsed CPU 4 seconds
* Build: samsung, serranoltexx, GT-I9195, ver. KOT49H.I9195XXUCOI4, rel. 4.4.2, fp. samsung/serranoltexx/serranolte:4.4.2/KOT49H/I9195XXUCOI4:user/release-keys
* Memory: Native heap size: 15615160 allocated / 228168 free, Runtime 16687104 total / 3826496 free / 100663296 max, 96 memory class
*
[...]

2016.05.31 23:31:17.077 +0200   [NETWRK.1044]   Connection to [imap.toppoint.de:143, tlsRelaxed] completed: imap.toppoint.de/217.70.197.9:143, time = 0.05 sec
2016.05.31 23:31:17.078 +0200   [NETWRK.1044]   Buffer sizes: 524288 send, 1048576 receive
2016.05.31 23:31:17.130 +0200   [IMAP_RAW.1044]   Data is <115>:
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED] Dovecot ready.

2016.05.31 23:31:17.141 +0200   [IMAP.1044]   Server greeting: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED] Dovecot ready.
2016.05.31 23:31:17.142 +0200   [IMAP.1044]   Server is Dovecot
2016.05.31 23:31:17.144 +0200   [IMAP.1044]   Sending: kman1 CAPABILITY
2016.05.31 23:31:17.190 +0200   [IMAP_RAW.1044]   Data is <171>:
* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED
kman1 OK Pre-login capabilities listed, post-login capabilities have more.

2016.05.31 23:31:17.193 +0200   [IMAP_RAW.1044]   Line: * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED
2016.05.31 23:31:17.196 +0200   [IMAP.1044]   Pre-login capabilities: CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED
2016.05.31 23:31:17.198 +0200   [IMAP_RAW.1044]   Line: kman1 OK Pre-login capabilities listed, post-login capabilities have more.
2016.05.31 23:31:17.204 +0200   [IMAP.1044]   Result for kman1: 0 Pre-login capabilities listed, post-login capabilities have more., traffic: 171 read, 18 write
2016.05.31 23:31:17.205 +0200   [IMAP.1044]   Sending: kman2 STARTTLS
2016.05.31 23:31:17.264 +0200   [IMAP_RAW.1044]   Data is <37>:
kman2 OK Begin TLS negotiation now.

2016.05.31 23:31:17.265 +0200   [IMAP_RAW.1044]   Line: kman2 OK Begin TLS negotiation now.
2016.05.31 23:31:17.271 +0200   [IMAP.1044]   Result for kman2: 0 Begin TLS negotiation now., traffic: 37 read, 16 write
2016.05.31 23:31:17.272 +0200   [NETWRK.1044]   Request for startTls content://org.kman.AquaMail.data/accounts/10000/test/imap to [imap.toppoint.de:143, tlsRelaxed]
2016.05.31 23:31:17.273 +0200   [NETWRK.1044]   Using relaxed SSL/STARTTLS factory
2016.05.31 23:31:17.277 +0200   [NETWRK.1044]   Reconnecting to [imap.toppoint.de:143, tlsRelaxed]
2016.05.31 23:31:17.292 +0200   SSLHardening   Hardening reorder: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, SSL_RSA_WITH_NULL_MD5, SSL_RSA_WITH_NULL_SHA, TLS_ECDH_ECDSA_WITH_NULL_SHA, TLS_ECDH_RSA_WITH_NULL_SHA, TLS_ECDHE_ECDSA_WITH_NULL_SHA, TLS_ECDHE_RSA_WITH_NULL_SHA, SSL_DH_anon_WITH_RC4_128_MD5, TLS_DH_anon_WITH_AES_128_CBC_SHA, TLS_DH_anon_WITH_AES_256_CBC_SHA, SSL_DH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_WITH_DES_CBC_SHA, TLS_ECDH_anon_WITH_RC4_128_SHA, TLS_ECDH_anon_WITH_AES_128_CBC_SHA, TLS_ECDH_anon_WITH_AES_256_CBC_SHA, TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_EXPORT_WITH_RC4_40_MD5, SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_ECDH_anon_WITH_NULL_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV, TLS_FALLBACK_SCSV], [TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_DH_anon_WITH_AES_256_GCM_SHA384, TLS_DH_anon_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_DH_anon_WITH_AES_128_CBC_SHA256, TLS_DH_anon_WITH_AES_256_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5], [SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
2016.05.31 23:31:17.303 +0200   SSLHardening   -> [TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_NULL_MD5, SSL_RSA_WITH_NULL_SHA, TLS_ECDH_ECDSA_WITH_NULL_SHA, TLS_ECDH_RSA_WITH_NULL_SHA, TLS_ECDHE_ECDSA_WITH_NULL_SHA, TLS_ECDHE_RSA_WITH_NULL_SHA, SSL_DH_anon_WITH_RC4_128_MD5, TLS_DH_anon_WITH_AES_128_CBC_SHA, TLS_DH_anon_WITH_AES_256_CBC_SHA, SSL_DH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_WITH_DES_CBC_SHA, TLS_ECDH_anon_WITH_RC4_128_SHA, TLS_ECDH_anon_WITH_AES_128_CBC_SHA, TLS_ECDH_anon_WITH_AES_256_CBC_SHA, TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_EXPORT_WITH_RC4_40_MD5, SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_ECDH_anon_WITH_NULL_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV, TLS_FALLBACK_SCSV]
2016.05.31 23:31:17.305 +0200   SSLHardening   Hardening reorder: [SSLv3, TLSv1, TLSv1.1, TLSv1.2], [TLSv1.2, TLSv1.1, TLSv1, SSLv3], [SSLv3]
2016.05.31 23:31:17.306 +0200   SSLHardening   -> [TLSv1.2, TLSv1.1, TLSv1]
2016.05.31 23:31:17.307 +0200   SSLHardening   Setting SSL ciphers: [TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_NULL_MD5, SSL_RSA_WITH_NULL_SHA, TLS_ECDH_ECDSA_WITH_NULL_SHA, TLS_ECDH_RSA_WITH_NULL_SHA, TLS_ECDHE_ECDSA_WITH_NULL_SHA, TLS_ECDHE_RSA_WITH_NULL_SHA, SSL_DH_anon_WITH_RC4_128_MD5, TLS_DH_anon_WITH_AES_128_CBC_SHA, TLS_DH_anon_WITH_AES_256_CBC_SHA, SSL_DH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_WITH_DES_CBC_SHA, TLS_ECDH_anon_WITH_RC4_128_SHA, TLS_ECDH_anon_WITH_AES_128_CBC_SHA, TLS_ECDH_anon_WITH_AES_256_CBC_SHA, TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_EXPORT_WITH_RC4_40_MD5, SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_ECDH_anon_WITH_NULL_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV, TLS_FALLBACK_SCSV]
2016.05.31 23:31:17.309 +0200   SSLHardening   Setting SSL protocols: [TLSv1.2, TLSv1.1, TLSv1]
2016.05.31 23:31:17.371 +0200   [NETWRK.1044]   Closing socket SSL socket over Socket[address=imap.toppoint.de/217.70.197.9,port=143,localPort=42295]
2016.05.31 23:31:17.391 +0200   [NETWRK.1044]   ***** ERROR: Unable to reconnect to [imap.toppoint.de:143, tlsRelaxed]
javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x646020f8: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5f8b27e8:0x00000000)
   at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:449)
   at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocketImpl.java:662)
   at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:633)
   at org.kman.AquaMail.net.MailSocketConnection.doReconnectImpl(MailSocketConnection.java:276)
   at org.kman.AquaMail.net.MailConnectionManager.startTls(MailConnectionManager.java:334)
   at org.kman.AquaMail.mail.imap.ImapTask.ensureStartTLS(ImapTask.java:72)
   at org.kman.AquaMail.mail.imap.ImapTask_CheckAccount.process(ImapTask_CheckAccount.java:124)
   at org.kman.AquaMail.core.MailTaskBaseExecutor.execute(MailTaskBaseExecutor.java:76)
   at org.kman.AquaMail.core.MailTaskQueueExecutor$MailTaskQueue.run(MailTaskQueueExecutor.java:620)
   at java.lang.Thread.run(Thread.java:841)
Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x646020f8: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5f8b27e8:0x00000000)
   at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
   at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:406)
   ... 9 more



I had to shorten log - if you miss important lines, I can send you an email.

Carsten.
Title: Re: server SSL/TLS config not compatible with Android < 5.0
Post by: Kostya Vasilyev on June 01, 2016, 01:15:26 am
Carsten,

Since I know there is nothing wrong with the app :) I won't be doing *all* the work for you.

But I did post a theory above (about SHA256) and it's consistent with your nmap output.

To complete this line of thought, please open the SSLSocket documentation and try to find any cipher with SHA256 or SHA384 which has "supported" lower than 20+ (API level 20 is Android 5.0). You won't be able to, there are none (unless I'm blind).

Or you can work it in reverse:

The actual list of ciphers enabled by AquaMail on the socket is under "Setting SSL ciphers", you won't find any of your ciphers there.

Or yet another way:

Look at the log under "Hardening reorder", it's a bit hard to pick apart, but it goes like this:

"Hardening reorder: [list of ciphers supported by the device], [the list of all ciphers known to AquaMail in hardening order], [blacklisted ciphers]"

You will see that none of your server ciphers appear on the supported list.
Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Calle on June 01, 2016, 01:46:28 am
Hi Kostya,

sorry for wasting your time  ;).

I'm more or less a computer security newbie - never heard about ssl-ciphers before.
With your help I managed to get some information about this. I asked my email-provider to enable some more ciphers in dovecot. I'll let you know if it works.

Many thanks for your answers.

Carsten.

Title: Re: email app is unavailable to check for mails when SSLv3 is disabling
Post by: Kostya Vasilyev on June 01, 2016, 01:53:17 am
Carsten,

Wasn't a total waste of time, and I'm glad you learned something too.

Yes, the ciphers are "too modern", all of them are only supported starting with 5.0.