|
|
(2 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| == Overview ==
| | {{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/other-development/implement-tlsv1.3}} |
| This guide provides resources and instructions on how to implement TLSv1.3, the latest version of the Transport Layer Security protocol, in your applications for enhanced security.
| |
| == Resources and References ==
| |
| * '''GitHub Project:'''
| |
| ** Access a relevant [https://github.com/google/conscrypt GitHub project] that provides detailed examples or libraries for implementing TLSv1.3.
| |
| * '''Additional Resources:'''
| |
| ** List any other [https://source.android.google.cn/devices/architecture/modular-system/conscrypt#conscrypt-format Resouces] that might be helpful for understanding and implementing TLSv1.3.
| |
| == Sample Code Snippet ==
| |
| * Include a brief description or title of the sample snippet.
| |
| <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 >
| |
| == Demo Application ==
| |
| * For a practical demonstration of TLSv1.3 in action, download the provided [http://ftp.wizarpos.com/advanceSDK/TestTLSV13.zip demo].
| |