我正在尝试使较旧的android设备(4.4和7.0)连接到TLS1.2服务器,但我一直在获取:
javax.net.ssl.SSLProtocolException:
SSL handshake aborted: ssl=0xb9585240: Failure in SSL library, usually a protocol error
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version (external/openssl/ssl/s23_clnt.c:741 0x9891f990:0x00000000)
我已经实现了netcipher库,但不确定Retrofit是否实际在使用它:
OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder()
.addInterceptor(new AuthorizationInterceptor());
// TODO: add Tor support
Intent statusIntent = new Intent();
statusIntent.putExtra(OrbotHelper.EXTRA_STATUS, OrbotHelper.STATUS_OFF);
try {
OkHttpClient client = StrongOkHttpClientBuilder
.forMaxSecurity(context)
.withWeakCiphers()
.applyTo(okHttpClientBuilder, statusIntent)
.build();
retrofit = new retrofit2.Retrofit.Builder()
.client(client)
.baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create())
.build();
} catch (Exception e) {
e.printStackTrace();
}
Nginx配置:https://github.com/Chocobozzz/PeerTube/blob/develop/support/nginx/peertube
关于我可能做错了什么的任何建议,或者在没有Android Play服务的情况下是否无法与TLS 1.2服务器对话?