android-tutorials-glide icon indicating copy to clipboard operation
android-tutorials-glide copied to clipboard

UnsafeOkHttpGlideModule doesn't work

Open chihung93 opened this issue 8 years ago • 2 comments

My AndroidMenifresh.xml


<?xml version="1.0" encoding="utf-8"?>
<manifest
    package="io.futurestud.tutorials.glide"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

        <!-- example -->
        <!--<meta-data-->
            <!--android:name="io.futurestud.tutorials.glide.glidemodule.SimpleGlideModule"-->
            <!--android:value="GlideModule" />-->

        <!--<meta-data-->
            <!--android:name="io.futurestud.tutorials.glide.glidemodule.CustomImageSizeGlideModule"-->
            <!--android:value="GlideModule" />-->

        <!-- for images behind an unsafe https url -->

        <meta-data
            android:name="io.futurestud.tutorials.glide.glidemodule.UnsafeOkHttpGlideModule"
            android:value="GlideModule" />


        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleSimpleLoading"
            android:label="Simple Loading"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleListViewAdapter"
            android:label="ListView Example"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleGridViewAdapter"
            android:label="GridView Example"/>

        <activity
            android:name=".ui.activities.UsageExamplePlaceholders"
            android:label="Placeholders"/>

        <activity
            android:name=".ui.activities.UsageExampleErrorLogging"
            android:label="Erorr Logging"/>

        <activity
            android:name=".ui.activities.UsageExampleCustomImageSize"
            android:label="Custom Image Sizes"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleImageResizing"
            android:label="Image Manipulation"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleCacheBasics"
            android:label="Cache Basics"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleAdvancedAdapter"
            android:label="Advanced ListView"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleThumbnails"
            android:label="Thumbnails"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleRequestPriority"
            android:label="Request Priority"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleTargetsAndRemoteViews"
            android:label="Rotation and Transformation"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleGifAndVideos"
            android:label="Gif and Local Videos"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleTransformations"
            android:label="Transformations"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleAnimate"
            android:label="Animations"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleGlideUrl"
            android:label="Glide URL"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleNetworkDependent"
            android:label="Network-Dependent"/>

        <activity
            android:name="io.futurestud.tutorials.glide.ui.activities.UsageExampleDownload"
            android:label="Download"/>

        <activity
            android:name=".ui.activities.UsageExampleGlideModuleUnsafeOkHttp"
            android:label="Picasso.Builder Basics"/>

        <receiver android:name=".ui.FSAppWidgetProvider">
            <intent-filter>
                <action
                    android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/app_widget"/>
        </receiver>

        <receiver
            android:name=".ui.FSAppWidgetIntentReceiver"
            android:label="widgetBroadcastReceiver">
            <intent-filter>
                <action android:name="pl.looksok.intent.action.CHANGE_PICTURE"/>
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/app_widget"/>
        </receiver>

    </application>

</manifest>


03-02 10:09:25.238 32386-32386/io.futurestud.tutorials.glide W/System.err: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
03-02 10:09:25.239 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:361)
03-02 10:09:25.239 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.internal.io.RealConnection.connectTls(RealConnection.java:195)
03-02 10:09:25.239 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.internal.io.RealConnection.connectSocket(RealConnection.java:148)
03-02 10:09:25.240 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.internal.io.RealConnection.connect(RealConnection.java:111)
03-02 10:09:25.240 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.internal.http.StreamAllocation.findConnection(StreamAllocation.java:188)
03-02 10:09:25.241 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:127)
03-02 10:09:25.241 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
03-02 10:09:25.241 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.internal.http.HttpEngine.connect(HttpEngine.java:289)
03-02 10:09:25.243 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.internal.http.HttpEngine.sendRequest(HttpEngine.java:241)
03-02 10:09:25.244 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.RealCall.getResponse(RealCall.java:240)
03-02 10:09:25.244 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:198)
03-02 10:09:25.245 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:160)
03-02 10:09:25.245 32386-32386/io.futurestud.tutorials.glide W/System.err:     at okhttp3.RealCall.execute(RealCall.java:57)
03-02 10:09:25.245 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.integration.okhttp3.OkHttpStreamFetcher.loadData(OkHttpStreamFetcher.java:43)
03-02 10:09:25.246 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.integration.okhttp3.OkHttpStreamFetcher.loadData(OkHttpStreamFetcher.java:19)
03-02 10:09:25.246 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.load.model.ImageVideoModelLoader$ImageVideoFetcher.loadData(ImageVideoModelLoader.java:70)
03-02 10:09:25.246 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.load.model.ImageVideoModelLoader$ImageVideoFetcher.loadData(ImageVideoModelLoader.java:53)
03-02 10:09:25.247 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.load.engine.DecodeJob.decodeSource(DecodeJob.java:170)
03-02 10:09:25.248 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.load.engine.DecodeJob.decodeFromSource(DecodeJob.java:128)
03-02 10:09:25.248 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.load.engine.EngineRunnable.decodeFromSource(EngineRunnable.java:122)
03-02 10:09:25.248 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.load.engine.EngineRunnable.decode(EngineRunnable.java:101)
03-02 10:09:25.248 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.load.engine.EngineRunnable.run(EngineRunnable.java:58)
03-02 10:09:25.249 32386-32386/io.futurestud.tutorials.glide W/System.err:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
03-02 10:09:25.249 32386-32386/io.futurestud.tutorials.glide W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-02 10:09:25.249 32386-32386/io.futurestud.tutorials.glide W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
03-02 10:09:25.249 32386-32386/io.futurestud.tutorials.glide W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
03-02 10:09:25.249 32386-32386/io.futurestud.tutorials.glide W/System.err:     at java.lang.Thread.run(Thread.java:761)
03-02 10:09:25.249 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:118)
03-02 10:09:25.250 32386-32386/io.futurestud.tutorials.glide W/System.err: Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
03-02 10:09:25.250 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:549)
03-02 10:09:25.251 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:401)
03-02 10:09:25.251 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:375)
03-02 10:09:25.251 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.android.org.conscrypt.TrustManagerImpl.getTrustedChainForServer(TrustManagerImpl.java:304)
03-02 10:09:25.251 32386-32386/io.futurestud.tutorials.glide W/System.err:     at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:94)
03-02 10:09:25.252 32386-32386/io.futurestud.tutorials.glide W/System.err:     at android.security.net.config.RootTrustManager.checkServerTrusted(RootTrustManager.java:88)
03-02 10:09:25.252 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.android.org.conscrypt.Platform.checkServerTrusted(Platform.java:178)
03-02 10:09:25.252 32386-32386/io.futurestud.tutorials.glide W/System.err:     at 



com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:596)
03-02 10:09:25.252 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
03-02 10:09:25.253 32386-32386/io.futurestud.tutorials.glide W/System.err:     at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357)
03-02 10:09:25.253 32386-32386/io.futurestud.tutorials.glide W/System.err: 	... 27 more
03-02 10:09:25.253 32386-32386/io.futurestud.tutorials.glide W/System.err: Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
03-02 10:09:25.253 32386-32386/io.futurestud.tutorials.glide W/System.err: 	... 37 more

chihung93 avatar Mar 02 '17 03:03 chihung93

Could you share an example image URL?

peitek avatar Mar 02 '17 05:03 peitek

https://dev-en.office.comparis.intra/immobilien/api/image/getdirect?guid=78caa03d-3432-47d8-bb19-025a87245d75&h=592&mw=1024&mh=1024&w=1080&rm=3

chihung93 avatar Mar 03 '17 01:03 chihung93