2017-07-31 4 views
3

私はssl https のサーバーと接続するためにREST APIを使用していますproblmはアンドロイドkitkatデバイスにあります。キットカットのバージョンや4.x.xが正常に動作し、接続javax.net.ssl.SSLException:ピアによって接続が閉じられました。アンドロイドkitkatのバージョン

を作るよりも、上記のすべてのデバイス上でサーバー

javax.net.ssl.SSLException: Connection closed by peer at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method) 

との接続を4.x.x行っていないと、すべてのデバイスは、そのための任意の解決策はあります。私もOkHttpを試してみましたが、私の原因でも働いていません。

答えて

1

私のエンドポイントがTLS 1.2を暗号化に使用していた前に、同様の問題が発生しました。エンドポイントでhttpsを使用している場合は、暗号化されていないapiコールでhttpに変更してみてください。それがオプションの場合。

あなただけがTLS 1.2

fun installSecurityProvider() { 
    try { 
     ProviderInstaller.installIfNeeded(activity) 
    } catch (e: GooglePlayServicesRepairableException) { 
     handlePlayServicesError(e.connectionStatusCode) 
    } catch (e: GooglePlayServicesNotAvailableException) { 
     handleCriticalFailure() 
    } 
} 

https://developer.android.com/training/articles/security-gms-provider.html

のサポートを提供するためにProviderInstallerを使用することができますGoogle Play Servicesとデバイス上のアプリをリリースしている場合は問題がありました。この議論okhttp gitのページに開かれました問題。

https://github.com/square/okhttp/issues/3098

プレイサービスに頼ることは、自分自身を実装するために、その可能なオプションではない場合。

https://github.com/square/okhttp/issues/2372#issuecomment-244807676

関連する問題