I have a simple andriod application , which has only one activity to load a webpage using a webview.While building the app I am using minimum sdk version as 24, which means the app should work on android 7 and above, but due to some reason when i launch my application in android 7.1 , I am getting ERR_SSL_VERSION_OR_CIPHER_MISMATCH error as below.
The server from which it is loading the webpage is using TLS v 1.3, somewhere i read by default android 7 uses TLS 1.2 , and this issue can come due to different tls version, so please help me if we can handle this issue without updating the browser version for android 7.
My WebView config
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
getSupportActionBar().hide();
setContentView(R.layout.activity_main);
webView = findViewById(R.id.test);
ProgressBar spinner = (ProgressBar)findViewById(R.id.progressBar);
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
webView.setWebViewClient(new CustomWebViewClient(spinner));
webView.setWebChromeClient(new CustomWebChromeClient(this,webChromeClientArgs));
webView.loadUrl("https://www.test.com/");
````
CodePudding user response:
By default TLS 1.3 is only enabled on Android 10 however that applies to apps using the Java API.
But Web browsers like Chrome and the Android WebView have their own TLS implementation, so they can have TLS 1.3 enabled by default on older Android versions. So make sure Chrome respectively Android System WebView are up-to-date.
You can check if Chrome or "Android System WebView" is used to provide WebView to apps in Android Developer options entry "WebView implementation".
At least your mentioned Chrome version is old and outdated. Chrome version 90 was released more than 2 years ago. Now (Nov 2023), latest Chrome version is 118.