diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2014-12-17 01:04:27 +0100 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2014-12-20 02:06:13 +0100 |
commit | f11382a244e13c488b3a4daaad994a9be9db2a81 (patch) | |
tree | 54795dd98d67ba9018b3bb85f42f55b65f2ed440 | |
parent | 926cb2372e7dc0455a476498e993eca6773e0533 (diff) | |
download | android_packages_apps_Email-f11382a244e13c488b3a4daaad994a9be9db2a81.tar.gz android_packages_apps_Email-f11382a244e13c488b3a4daaad994a9be9db2a81.tar.bz2 android_packages_apps_Email-f11382a244e13c488b3a4daaad994a9be9db2a81.zip |
email: start handshake before hostname verification
Start handshake prior to hostname verification to ensure exceptions do not get silenced
Change-Id: Ide60753663d82d63b0f410b985447b7b26efd8f1
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r-- | emailcommon/src/com/android/emailcommon/utility/SSLSocketFactory.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/emailcommon/src/com/android/emailcommon/utility/SSLSocketFactory.java b/emailcommon/src/com/android/emailcommon/utility/SSLSocketFactory.java index 4d19e158c..7a0c24c1c 100644 --- a/emailcommon/src/com/android/emailcommon/utility/SSLSocketFactory.java +++ b/emailcommon/src/com/android/emailcommon/utility/SSLSocketFactory.java @@ -335,6 +335,10 @@ public class SSLSocketFactory implements LayeredSocketFactory { // Set Server Name Indication if is available for this socket setSocketHostname(sslsock, host); + // Start handshake prior to hostname verification to ensure + // handshake exceptions do not get silenced by hostname verification. + sslsock.startHandshake(); + try { hostnameVerifier.verify(host, sslsock); // verifyHostName() didn't blowup - good! @@ -402,6 +406,10 @@ public class SSLSocketFactory implements LayeredSocketFactory { // Set Server Name Indication if it's available for this socket setSocketHostname(sslSocket, host); + // Start handshake prior to hostname verification to ensure + // handshake exceptions do not get silenced by hostname verification. + sslSocket.startHandshake(); + hostnameVerifier.verify(host, sslSocket); // verifyHostName() didn't blowup - good! return sslSocket; |