helpcrunch / android-sdk-demo

Public demo for HelpCrunch Android SDK
Apache License 2.0
9 stars 1 forks source link

CLEARTEXT communication to ucarecdn.com not permitted by network security policy #44

Closed nostra13 closed 3 years ago

nostra13 commented 3 years ago

Can you use HTTPS instead of HTTP for avatars from https://ucarecdn.com ? Using HTTP causes CLEARTEXT violation:

E/RealImageLoader: java.net.UnknownServiceException: CLEARTEXT communication to ucarecdn.com not permitted by network security policy
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:188)
        at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
        at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
        at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
        at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
        Suppressed: java.net.UnknownServiceException: CLEARTEXT communication to ucarecdn.com not permitted by network security policy
            ... 18 more
        Suppressed: java.net.UnknownServiceException: CLEARTEXT communication to ucarecdn.com not permitted by network security policy
            ... 18 more
        Suppressed: java.net.UnknownServiceException: CLEARTEXT communication to ucarecdn.com not permitted by network security policy
            ... 18 more

I can add exception to network config but I prefer not to if we can simply use HTTPS.

TalbotGooday commented 3 years ago

Hi! Thanks for reporting. I don't remember why but there are was a reason why there are HTTP instead of HTTPS. There are was something with the ucarecdn and that was the only solution. I'll check this again and change the protocol if possible