首页 > 解决方案 > 改造 ssl=0x717f870208:系统调用期间的 I/O 错误,对等方重置连接

问题描述

我的代码工作正常,我从服务器接收到数据,但突然出现此错误: javax.net.ssl.SSLException: Read error: ssl=0x717c368708: I/O error during system call, Connection reset by peer

有时我也会收到此错误:

com.google.gson.stream.MalformedJsonException: 
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

我正在使用改造

implementation 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
implementation 'com.squareup.retrofit2:converter-gson:2.0.0-beta4' 

这是它的初始化

 Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl).
                addConverterFactory(GsonConverterFactory.create()).build();
 Api api = retrofit.create(Api.class);
 Call<ProfileResult> profileCallBack = api.getProfileData();

标签: androidandroid-studiossl-certificateretrofit

解决方案


我发现问题出在我的 ISP 中,它将我重定向到他们的网站以显示有关互联网消费的消息并停留在该重定向中,当我使用数据或其他 WiFi 运行应用程序时,它工作正常!


推荐阅读