ほとんどのデバイスでうまく機能していたアンドロイドアプリケーションがあります 最近、一部のハッカーが私たちのサーバーでDDoS攻撃を試み、javax.net.ssl.SSLException:アンドロイドの古いデバイスでSSLハンドシェイクが中止されました
ない一部のデバイスが動作し、私に次の例外
javax.net.ssl.SSLException: SSL handshake aborted: ssl=0x63eb8240: I/O error during system call, Connection reset by peer
を与えていない一部のファイアウォールは、いずれも、何が今の問題です教えてくださいすることができ、どのように私はそれを解決できますか?
EDIT
これは、異なるAndroidのAPIレベルは、SSL/TLSのためのさまざまなサポートが詳細は、Android Documentionで見るためのバージョン、プロトコル持っている私のexecuteメソッド
public static BaseResponse execute(Context context, BaseRequest request) {
mStartTime = System.nanoTime();
BaseResponse response = new BaseResponse();
DataOutputStream outputStream;
try {
URL url = new URL(request.getURL());
HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();
urlConnection.setConnectTimeout(TIMEOUT_DURATION);
urlConnection.setReadTimeout(TIMEOUT_DURATION);
urlConnection.setRequestMethod(request.getRequestType().getValue());
urlConnection.addRequestProperty("Accept", "application/json");
urlConnection.addRequestProperty("Content-Type","application/json");
urlConnection.setRequestProperty("Accept-Charset", CHARACTER_SET);
urlConnection.addRequestProperty("Device-Id", PhoneUtils.getDeviceId(context));
urlConnection.addRequestProperty("Version-Number", PhoneUtils.getAppVersion(context));
TLSSocketFactory socketFactory = new TLSSocketFactory();
urlConnection.setSSLSocketFactory(socketFactory);
switch (request.getRequestType()) {
case POST:
case PUT:
urlConnection.setDoOutput(true);
if (request.getStringEntity() != null) {
outputStream = new DataOutputStream(urlConnection.getOutputStream());
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream, CHARACTER_SET));
writer.write(request.getStringParam());
writer.close();
outputStream.flush();
outputStream.close();
}
break;
case GET:
urlConnection.setDoOutput(false);
break;
}
urlConnection.connect();
try {
if (urlConnection.getResponseCode() == STATUS_OK) {
InputStream inputStream = new BufferedInputStream(urlConnection.getInputStream());
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder result = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
result.append(line);
}
inputStream.close();
response.setResponse(convertStringToJSONObject(result.toString()));
} else {
response.setResponse(null);
}
} catch (Exception ex) {
response.setAppError(AppError.DATA_ERROR);
}
} catch (MalformedURLException e) {
e.printStackTrace();
response.setAppError(AppError.PARSING_ERROR);
} catch (IOException e) {
e.printStackTrace();
response.setAppError(AppError.DATA_ERROR);
} catch (Exception e) {
e.printStackTrace();
response.setAppError(AppError.DATA_ERROR);
}
return response;
}
[javax.net.ssl.SSLException:読み取りエラー:ssl = 0x9524b800:システムコール中のI/Oエラー、ピアによる接続リセット] /stackoverflow.com/questions/30538640/javax-net-ssl-sslexception-read-error-ssl-0x9524b800-io-error-during-system) – halileohalilei