Reputation: 11
My App is working fine in the actual device where as it's crashing on launch in the emulator. below is the log.
E/FirebaseInstanceId: Failed to get FIS auth token
java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: Unacceptable certificate: [email protected], CN=caadmin.netskope.com, O=netSkope Inc, L=London, ST=London, C=GB
at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
at com.google.firebase.iid.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-iid@@20.2.3:55)
at com.google.firebase.iid.GmsRpc.startRpc(com.google.firebase:firebase-iid@@20.2.3:37)
at com.google.firebase.iid.GmsRpc.getToken(com.google.firebase:firebase-iid@@20.2.3:13)
at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$2$FirebaseInstanceId(com.google.firebase:firebase-iid@@20.2.3:164)
at com.google.firebase.iid.FirebaseInstanceId$$Lambda$4.start(Unknown Source:8)
at com.google.firebase.iid.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-iid@@20.2.3:14)
at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$3$FirebaseInstanceId(com.google.firebase:firebase-iid@@20.2.3:163)
at com.google.firebase.iid.FirebaseInstanceId$$Lambda$1.then(Unknown Source:6)
at com.google.android.gms.tasks.zzf.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:6)
at java.lang.Thread.run(Thread.java:919)
Caused by: javax.net.ssl.SSLHandshakeException: Unacceptable certificate: [email protected], CN=caadmin.netskope.com, O=netSkope Inc, L=London, ST=London, C=GB
at com.android.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(ConscryptFileDescriptorSocket.java:231)
Upvotes: 0
Views: 376
Reputation: 36
Every app has to explicitly add the user defined certificates:
res/xml/network_security_config.xml
<network-security-config>
<base-config>
<trust-anchors>
<certificates src="system"/>
<certificates src="user"/>
</trust-anchors>
</base-config>
</network-security-config>
Also make sure the AndroidManifest.xml contains the android:networkSecurityConfig attribute in the tag:
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
<application android:networkSecurityConfig="@xml/network_security_config"
... >
...
</application>
</manifest>
Upvotes: 1