How to Implement TLSv1.3 in Applications
References
Sample
Snippet Code:
Provider conscrypt = Conscrypt.newProvider();
// Add as provider
Security.insertProviderAt(conscrypt, 1);
SSLContext context = SSLContext.getInstance("TLSv1.3");
context.init(null/*keyManagers*/, null /*new CtsTrustManager[] {trustManager}*/, null);
SSLSocketFactory factory = context.getSocketFactory();
URL sslURL = new URL("https://www.vpslala.com/");
HttpsURLConnection con = (HttpsURLConnection) sslURL.openConnection();
con.setSSLSocketFactory(factory);
Log.d("SQLTest", "SQLTestTLS13. "+con.getResponseMessage());