Deprecation of TLS 1.0 and 1.1: Android 10 disables TLS 1.0 and TLS 1.1 by default due to known vulnerabilities in these older protocols.
Enhanced Security: By requiring TLS 1.2 or newer, Android 10 and later versions improve the security of network communications.
Developer Implications: Apps that rely on legacy servers supporting only TLS 1.0 or TLS 1.1 may encounter connection issues on devices running Android 10 or higher. Developers are encouraged to update their server configurations and client code to support TLS 1.2 or TLS 1.3.
Industry Alignment: This move is in line with broader industry trends, where many platforms and browsers have also phased out support for TLS 1.0 and 1.1.
If you’re maintaining an app or server infrastructure, it’s important to verify that your connections support TLS 1.2 or higher to ensure compatibility with Android 10+ devices.
Self‑Signed CA
Step 1. Create a Self‑Signed CA with SANs
1.1 Create an OpenSSL Configuration File for the CA (ca.cnf)
Create a file named ca.cnf with the following content. This file tells OpenSSL to include SANs in the CA certificate and sets the proper CA extensions.
[ dn ] C = US ST = State L = City O = MyOrg OU = MyUnit CN = MyLocalCA
[ v3_ca ] # Add Subject Alternative Names to the CA certificate subjectAltName = @alt_names # Indicate this certificate is a CA basicConstraints = critical, CA:TRUE, pathlen:0 keyUsage = critical, digitalSignature, cRLSign, keyCertSign subjectKeyIdentifier = hash
`X509v3 Subject Alternative Name: DNS:realmjon.mynetgear.com, DNS:www.realmjon.mynetgear.com, DNS:api.realmjon.mynetgear.com`
Step6. OkHttp Demo Code
Below is an example Java class demonstrating how to load the CA from assets, configure the SSL context for TLSv1.3, and make an asynchronous HTTPS request using OkHttp. Make sure to execute network calls off the main thread (this example uses a separate thread):
publicstaticvoidmakeRequest(final Context context) { newThread(() -> { try { // Load the CA certificate from the assets folder CertificateFactorycf= CertificateFactory.getInstance("X.509"); InputStreamcaInput= context.getAssets().open("ca.crt"); Certificateca= cf.generateCertificate(caInput); caInput.close();
// Create a KeyStore containing the trusted CA KeyStorekeyStore= KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load(null, null); keyStore.setCertificateEntry("ca", ca);
// Create a TrustManager that trusts the CA in our KeyStore TrustManagerFactorytmf= TrustManagerFactory.getInstance( TrustManagerFactory.getDefaultAlgorithm()); tmf.init(keyStore); TrustManager[] trustManagers = tmf.getTrustManagers(); X509TrustManagertrustManager=null; for (TrustManager tm : trustManagers) { if (tm instanceof X509TrustManager) { trustManager = (X509TrustManager) tm; break; } } if (trustManager == null) { thrownewIllegalStateException("No X509TrustManager found"); }
// Create an SSLContext for TLSv1.3 SSLContextsslContext= SSLContext.getInstance("TLSv1.3"); sslContext.init(null, newTrustManager[]{trustManager}, null);
// Build the OkHttpClient with the custom SSL settings OkHttpClientclient=newOkHttpClient.Builder() .sslSocketFactory(sslContext.getSocketFactory(), trustManager) .hostnameVerifier(newHostnameVerifier() { @Override publicbooleanverify(String hostname, SSLSession session) { // Accept the specific IP address (replace with your actual server IP) return hostname.equals("192.168.1.100"); } }) .build();
// Build and execute the HTTPS request (adjust URL, port, and path as needed) Requestrequest=newRequest.Builder() .url("https://192.168.1.100:8443/") .build();
generate host “realmjon.mynetgear.com” self-sign CA make both server.crt ca.crt have subjectalternativenames , config in the springboot
ChatGPT said:
Reasoned for 17 seconds
Below is a complete guide that shows you how to create a self‑signed CA and use it to sign a server certificate for the host realmjon.mynetgear.com, ensuring that both the CA certificate and the server certificate include Subject Alternative Names (SANs). Finally, you’ll see how to package the server certificate into a PKCS#12 keystore for Spring Boot configuration.
Summary
Local CA Creation:
Created a self‑signed CA certificate (ca.crt) that includes SANs (via ca.cnf).
Server Certificate:
Generated a CSR and signed it with the CA to produce server.crt for realmjon.mynetgear.com with SANs (via server.cnf).
PKCS#12 Keystore:
Combined the server certificate and key (with the CA certificate) into server.p12.
Spring Boot Configuration:
Configured Spring Boot to use server.p12 for HTTPS.
Verification:
Used OpenSSL commands to verify that both certificates contain the correct SAN entries.
Following these steps ensures that both your CA and server certificates include the desired Subject Alternative Names and that your Spring Boot application is correctly configured for HTTPS.