AndroidのVolleyはHTTPS通信のタイムアウト時にSSLHandshakeException を発生させる

もう泣かないためにメモ。
Android用の通信処理ライブラリVolleyで、HTTPSの通信を行っていたら、こんな例外が出た。

``` java
01-22 19:41:30.647  32296-32296/com.hogehoge E/HogeClient﹕ javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x599e5468: 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 0x5d083d74:0x00000000)
    com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x599e5468: 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 0x5d083d74:0x00000000)
            at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:151)
            at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:112)
     Caused by: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x599e5468: 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 0x5d083d74:0x00000000)
            at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:449)
            at com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
            at com.android.okhttp.Connection.connect(Connection.java:107)
            at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
            at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
            at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
            at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:136)
            at com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:109)
            at com.hogehoge.network.MultiPartStack.performRequest(MultiPartStack.java:57)
            at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:96)
            ... 1 more
     Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x599e5468: 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 0x5d083d74:0x00000000)
            at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
            at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:406)
            ... 13 more
```

これ、どこをどうみてもSSL関連のエラーだと思うじゃん？SSLHandshakeException とか言うてるし。
でも違うのよ。これタイムアウトなの。

Volleyって、HTTPSのタイムアウトがSSLHandshakeException として出ちゃうのよ。
対策としてはこちらの記事を参考に、タイムアウト値を伸ばすこと。
http://qiita.com/ya1_3241_ba/items/c6a5ebb93afbae3d039a

これだけだった…。
証明書とかの見直しに1時間くらいかかった。
今日こそ早く帰って嫁とご飯食うぞ。