Ffimageloading: Android: SecureChannelFailure

Created on 26 Jan 2017  路  8Comments  路  Source: luberda-molinet/FFImageLoading

Hi,

I'm using XF Version 2.3.4.180 and FFImageLoading 2.2.7 and getting the error
SecureChannelFailure (The authentication or decryption has failed.)
when trying to load an image from my ssl secured webpage. The page is using TLS1.2 and I assume this could be the problem but all other requests are working. I'm using ModernHttpHandler with NativeHttpHandler.
I tried also changing the HttpClient Implementation to "AndroidClientHandler" what seems to work in debug (no idea why...) but doesn't work in release....

I'm getting crazy on this....

Same stuff works pretty well on iOS.

Full Stacktrace:
error.txt

question

Most helpful comment

Hi all,
just in case anyone else has this problem (like me): According to the TLS Guide by Xamarin, the default settings for older Android Projects do not support TLS 1.2. I got the same error message because my SSL certificate is issued by Googles Let's Encrypt which uses TLS 1.2.

So to fix this error, I set HTTPClientImplementation to "AndroidClientHandler" and "SSL/TLS implementation" to "Native TLS 1.2+" as described in above link and now FFImageLoading loads all the images from my server via HTTPS.

All 8 comments

There's something wrong with your certificate. Call this when initialising your app: ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => { return true; };

thanks for the quick reply...
The certificate should be alright.... I already tried the certification validation and didn't help. Also all checks from ssllabs.com are correct and browser checks worked too...
I just figured out that when I choose the AndroidClientHandler and disable the Linker it also works in the release.... looks like the linker removes it and Forms jumps back to the default handler...
Could this be possible?
Then I only have to figure out how to prevent the linker from removing it :-)

It might be some Xamarin.Android issue. Maybe you should report it to their bugzilla? You can add some assemblies to linker whitelist, but you'll need to figure it out which ones are needed.

hm... yes looks like you're right.
Will report it. Thanks and sry for the inconvenience.

Not a problem, if you have any news or questions, just write. Maybe we could put some info to our WIKI for other users if there's any solution.

Hi all,
just in case anyone else has this problem (like me): According to the TLS Guide by Xamarin, the default settings for older Android Projects do not support TLS 1.2. I got the same error message because my SSL certificate is issued by Googles Let's Encrypt which uses TLS 1.2.

So to fix this error, I set HTTPClientImplementation to "AndroidClientHandler" and "SSL/TLS implementation" to "Native TLS 1.2+" as described in above link and now FFImageLoading loads all the images from my server via HTTPS.

Just ran into this issue when updating FFImageLoading from 2.2.9 to the latest. Setting TLS 1.2 using the guide mentioned above also resolved the problem. Thanks!

Why don't the photos open? cdn.vatanbgs

android
5
4.3
4.2

https://www.cdn.vatanbgs.com/Content/Images/Products/460_466/637089327869489423.jpg
https://cdn.vatanbgs.com/Content/Images/Products/460_466/637089327869489423.jpg

And I couldn't solve the problem, and the problem is with https for androind 4 3 5 only

error tls 1.2

FFImageLoading.Exceptions.DownloadAggregateException: One or more errors occurred. (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tommigun1980 picture Tommigun1980  路  16Comments

jorgenstorlie picture jorgenstorlie  路  28Comments

stesvis picture stesvis  路  144Comments

JTOne123 picture JTOne123  路  22Comments

ManhDucIT picture ManhDucIT  路  22Comments