5

I am implementing Facebook Login in my App but its not working on Api 2.3.6

I have tested the App in Emulator and its working Fine upto Api 23

Also it's working in Device with API 21 but not in 2.3.6

The Error is related to SSL

Bcoz I have read in an SO answer that,

  • in Api level 2.3.6 all connections and authorizations are handled by HTTPS only while in Api levels above 2.3.6 its not the HTTPS that does every task

  • Also I have noticed that whenever I am trying to call any URL starting
    with HTTPS it's not giving the final result but gets silently stopped as was the case with Googles Direction Api.

Below is the StackTrace I am getting in 2.3.6 :

 V/webkit: LoadListener.handleSslErrorRequest():   
  url:https://m.facebook.com/v2.4/dialog/oauth?
    return_scopes=true&response_type=token%2Csigned_request&redirect_uri
    =fbconnect%3A%2F%2Fsuccess&display=touch&sdk=android-  
    4.5.1&e2e=%7B%22init%22%1232%7D&client_id=1234&default_audience=friends   
    primary error: 3 certificate: Issued to: CN=*.facebook.com,O=Facebook\,  
    Inc.,L=Menlo Park,ST=CA,C=US;
    Issued by: 1.2.840.113549.1.9.1=#1223,CN=Cyberoam SSL  
    CA_C016700030,OU=Cyberoam Certificate 
    Authority,O=Elitecore,L=Ahmedabad,ST=Gujarat,C=IN;

    I/System.out: close [socket][/0.0.0.0:52994]
    I/webkit/webview: WebView.stopLoading()
    D/webkit/webview: WebView.stopLoading(): webcorethread is initialized
    I/webkit/webview: WebView.stopLoading()
    D/webkit/webview: WebView.stopLoading(): webcorethread is initialized
    W/System.err:     at    
    com.facebook.login.LoginManager.onActivityResult(LoginManager.java:173)
    W/System.err:  at     
    com.facebook.login.LoginManager$1.onActivityResult(LoginManager.java:139)
    W/System.err:     at    
    com.facebook.internal.CallbackManagerImpl.onActivityResult
    (CallbackManagerImpl.java:82)
    W/System.err:     at     
    com.hogo.integrationapp.FirstActivity.onActivityResult
    (FirstActivity.java:179)
    W/System.err:     at   
    android.app.Activity.dispatchActivityResult(Activity.java:3975)
    W/System.err:     at 
    android.app.ActivityThread.deliverResults(ActivityThread.java:2629)
    W/System.err:     at  
    android.app.ActivityThread.handleSendResult(ActivityThread.java:2675)
    W/System.err:     at   
    android.app.ActivityThread.access$2000(ActivityThread.java:156)
    W/System.err:     at 
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1030)
    W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:130)
    W/System.err:     at android.os.Looper.loop(SourceFile:351)
    W/System.err:     at   
    android.app.ActivityThread.main(ActivityThread.java:3821)
    W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err:     at java.lang.reflect.Method.invoke(Method.java:538)
    W/System.err:     at 
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run\
    (ZygoteInit.java:969)
    W/System.err:     at   
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:727)
    W/System.err:     at dalvik.system.NativeStart.main(Native Method)

Is there any Easy way to solve it ?

Also I want to understand why this is happening ?

I am using Facebook Sdk 4.5.1

For API 4.4.2 : The Error was due to a File Transfer App open in my Device, when i closed it the error was gone

Thanks in Advance...

Ashish Shukla
  • 1,027
  • 16
  • 36
  • Have seen similar error while using 2.3. This issue is related to SSL and OS. There was a bug raised against OS. Did you try in any other device with higher API level? – Balu SKT Feb 29 '16 at 12:03
  • Try importing the certificate manually. This is just to make sure its due to SSL error. – Balu SKT Feb 29 '16 at 12:24
  • @BaluSKT i have edited my question – Ashish Shukla Mar 02 '16 at 11:32
  • 1
    I think you should look into here: http://stackoverflow.com/questions/9574870/no-peer-certificate-error-in-android-2-3-but-not-in-4 – MarkySmarky Mar 07 '16 at 17:56
  • Please post the stacktract as text. Images can't be searched and hence your question will not be helpful community in the future. – Sufian Mar 08 '16 at 10:27
  • @Sufian i have added the Stacktrace – Ashish Shukla Mar 08 '16 at 11:32
  • @MarkySmarky I followed your link and i followed the accepted answer and found that the first to points may be related to my problem ,so i used openssl command and found that *.facebook.com is using Digicert CA and i checked the list of trusted CA's on Android 2.3.6 in the link and found Digicert in the list.So that concludes that my problem is related to the second point ie SNI.And i think facebook supports SNI bcoz of this link https://www.facebook.com/notes/facebook-security/securely-developing-on-mobile/10151408888270766/ , So what should i do to support SNI in my App? – Ashish Shukla Mar 09 '16 at 06:08
  • see this link http://stackoverflow.com/questions/35782882/how-do-we-enable-sni-in-httpclient-4-4-on-android – N J Mar 10 '16 at 05:51
  • Can you try to bypass the SSL in your application? – Silvans Solanki Mar 10 '16 at 06:28

0 Answers0