Android Question ResponseError. Reason: javax.net.ssl.SSLHandshakeException: Connection closed by peer, Response:

Flavio SOuza

Member
Licensed User
Longtime User

That's right... thank you. Now I just need to know how to do this...
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
Well, I decided to look under API 16 (where TLS 1.1, TLS 1.2 are disabled by default).
At first I got a message about untrusted certificate. Ok, I use InitializeAcceptAll. And got
B4X:
<html>
    <head>
        <title>SIBEC - Sistema de Benef�cios ao Cidad�o</title>
    </head>
    <frameset framespacing="0" border="0" frameborder="0" src="blank.htm" cols="0%,100%,0%,0%">
        <frame name="EscondidoJS" src="#" scrolling="auto">
        <frame name="Principal"    src="04.01.00-00_01.asp" scrolling="auto">
        <frame name="EscondidoASP" src="#" scrolling="auto">
        <frame name="EscondidoASP1"    src="#" scrolling="auto">
    </frameset>
    <noframes></noframes>
</html>

Even if to solve a problem with protocols under modern API, just curious, how do you plan to process similar html ?
 
Upvote 0

Flavio SOuza

Member
Licensed User
Longtime User

I actually changed the SDK version to 16 and it worked. But I need 26 to publish to Google play. any idea of what you can do
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
OkHttp is an open-source library.
It looks that, the most simple solution is to correct https://github.com/square/okhttp/blob/master/okhttp/src/main/java/okhttp3/ConnectionSpec.java
and to remove TLS 1.1-1.3 from here.

B4X:
public static final ConnectionSpec MODERN_TLS = new Builder(true)
.cipherSuites(APPROVED_CIPHER_SUITES)
.tlsVersions(TlsVersion.TLS_1_3, TlsVersion.TLS_1_2, TlsVersion.TLS_1_1, TlsVersion.TLS_1_0)
.supportsTlsExtensions(true)
.build();

But I don't know tools, which allow to change jar 'on fly'. JD, for example, is a simple viewer.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…