Read error: Failure in SSL library, usually a protocol error

半城伤御伤魂 提交于 2019-12-22 06:36:21

问题


I am trying to access an secure url by using a DefaultHttpClient. I am creating BKS file using portecel tool.

The jks file created using the same is working fine in java program but the bks is throwing the following exception:

java.io.IOException: Read error: Failure in SSL library, usually a protocol error

I am able to open the bks file in a keystore explorer and see the details.

The same is working fine in Android 2.3 but not in 2.2

let me know if anybody has faced such problem and solved it.


回答1:


I encountered the same problem in one of my applications. After googling a bit I found a bugreport from k9mail which refers to this bugreport on Android 2.2 and some more posts all indicating this is a framework bug in 2.2.

I found several sources like this one mentioning that importing the certificates server-side has to be done in some specific order, in order for Android to accept it. Since I have no control over the server I didn't pursue this option and I have no clue if it actually works; however, it might be interesting for you to investigate further.




回答2:


Check whether the server want client authentication.




回答3:


I had this problem with Retrofit Library. I solved this change, "https://10.0.3.2:4567" to "http://10.0.3.2:4567" in my URL connection.



来源:https://stackoverflow.com/questions/8700667/read-error-failure-in-ssl-library-usually-a-protocol-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!