How to Implement TLSv1.3 in Applications: Difference between revisions

From wizarPOS
No edit summary
(Replaced content with "{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/other-development/implement-tlsv1.3}}")
Tag: Replaced
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== References ==
{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/other-development/implement-tlsv1.3}}
[https://github.com/google/conscrypt GitHub project]
 
[https://source.android.google.cn/devices/architecture/modular-system/conscrypt#conscrypt-format Resouces]
 
== Sample ==
Snippet Code:
<syntaxhighlight lang="java">
    /**
    * dependencies implementation 'org.conscrypt:conscrypt-android:2.5.2'
    * @param url
    */
    private void tlsv13(String url) {
        Provider conscrypt = Conscrypt.newProvider();
        try {
            SSLContext context = SSLContext.getInstance("TLSv1.3",conscrypt);
            context.init(null/*keyManagers*/, null /*new CtsTrustManager[] {trustManager}*/, null);
            SSLSocketFactory factory = context.getSocketFactory();
            URL sslURL = new URL(url);
            HttpsURLConnection con = (HttpsURLConnection) sslURL.openConnection();
            con.setSSLSocketFactory(factory);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
</syntaxhighlight >
Please download [http://ftp.wizarpos.com/advanceSDK/TestTLSV13.zip demo]

Latest revision as of 03:28, 8 April 2024

Please visit new link of same subject:

https://smartpossdk.gitbook.io/cloudpossdk/faq/other-development/implement-tlsv1.3

We're making a move! Our site's content is migrating to a new URL, to provide you with an enhanced browsing experience. Please update your bookmarks accordingly. Thank you for your continuous support!