Android Question WebView, Android 4.4.2 and Https

lagore

Active Member
Licensed User
Longtime User
I am using a WebView to access a secure site "https://portal.aerlingus.com" which redirects to a NetScaler login site to log into a company site, on Android 6.0 this works perfectly but on 4.4.2 and below it just comes up with "Web page not available" there is no redirection no errors etc?
Edward
 

lagore

Active Member
Licensed User
Longtime User
Unfortunately I am away from my system until Wednesday but I have had issues using OkHttpUtils2 on older phones as posted on another thread "https://www.b4x.com/android/forum/t...ttputils2-android-versions.79992/#post-506545" I do think it is an SSL issue when I use the browser on a 4.4.2 android phone it has the same problem in not showing the site and reporting "unable to establish a secure connection" . I did run ssllab on the website and it indicated that android 4.4.2 should be ok?
Edward
 
Upvote 0

lagore

Active Member
Licensed User
Longtime User
Having some more reading and testing the protocol required by the server site is TLS v1.2 but this protocol is supported but not default on android 16+ <= API <= 21 so when the sslSocket is created it needs to force TLS v1.2 with something like :
B4X:
private Socket patch(Socket s) {
        if (s instanceof SSLSocket) {
            ((SSLSocket) s).setEnabledProtocols("TLSv1.2");
        }
        return s;
    }
There is a thread which has come up with a java solution, will I have to create my own version of OkHttp using their methods or is there a simpler way of modifying the stock OKHttp to do this?
Edward
 
Upvote 0
Top