vimeo / vimeo-networking-java

The Vimeo Java (Android) SDK
MIT License
121 stars 49 forks source link

Unable to extract the trust manager on Android10Platform, sslSocketFactory is class com.android.org.conscrypt.OpenSSLSocketFactoryImpl site:stackoverflow.com #449

Open terence-codigo opened 3 years ago

terence-codigo commented 3 years ago

Issue Summary

I'm using version 1.1.3. VimeoClient crashes upon initialize with the following stack trace:

Caused by: java.lang.IllegalStateException: Unable to extract the trust manager on Android10Platform, sslSocketFactory is class com.android.org.conscrypt.OpenSSLSocketFactoryImpl
        at okhttp3.OkHttpClient$Builder.sslSocketFactory(OkHttpClient.kt:751)
        at com.vimeo.networking.RetrofitClientBuilder.build(RetrofitClientBuilder.java:186)
        at com.vimeo.networking.VimeoClient.createOkHttpClient(VimeoClient.java:182)
        at com.vimeo.networking.VimeoClient.createRetrofit(VimeoClient.java:132)
        at com.vimeo.networking.VimeoClient.<init>(VimeoClient.java:121)
        at com.vimeo.networking.VimeoClient.initialize(VimeoClient.java:114)

Reproduction Steps

Initialize the VimeoClient.

Expected Behavior

VimeoClient initializes.

Actual Behavior

VimeoClient throws IllegalStateException upon initialize.

Cosmopal commented 3 years ago

Yes, facing the same issue

iamdamjanmiloshevski commented 3 years ago

I'm experiencing this too!

iamdamjanmiloshevski commented 3 years ago

Managed to solve it with the help of this https://stackoverflow.com/questions/65737921/vimeo-networking-library-crash-for-android-10-platform-api29/65771964#65771964.

Hope it helps everybody else until Vimeo releases a fix

filwiesner commented 3 years ago

So I assume the problem is related to this issue and as per the comment in the linked SO answer the solution "makes the connection insecure". Is this fixed in some alpha versions of this lib or are there any other workarounds for this problem? Because this "bug" makes this lib unusable. cc. @anthonycr @WhosNickDoglio

filwiesner commented 3 years ago

I guess the team is inactive because they are working on version 2.0 which will fix a lot of current issues but a simple "We are working on it" would go a long way.

anthonycr commented 3 years ago

Really sorry for the issues you're all running into with the release version.

My advice is to use to the alpha versions of the library from Jitpack (latest is 2.0.0-alpha.86 as of writing this) instead of the 1.1.3 release version on Jcenter. It's what we use in the Vimeo Android app, and keep it up to date. Unfortunately there is a decent amount of documentation work to be done for us to be able to release 2.0 as a non-alpha version, and since the primary job of us library maintainers is to work on Vimeo's Android app and not this library (we aren't on the API team), we haven't been able to take the time to finish it up.

If you as a Vimeo user want to see this library ship regularly to a release channel, I suggest contacting support by filing a ticket and letting them know that you need public, regular releases of this library.

If you're fine to use alpha versions (which are stable enough to ship in production), then I suggest doing that.

filwiesner commented 3 years ago

Thank you for your answer. I almost lost hope :sweat_smile: I've tried the alpha versions but I get conflict errors when trying to build:

...(20 similar errors with different classes)...
Duplicate class com.vimeo.networking2.params.SearchSortType found in the following modules: 
jetified-models-2.0.0-alpha.88 (com.github.vimeo.vimeo-networking-java:models:2.0.0-alpha.88),   
jetified-models-parcelable-2.0.0-alpha.88-runtime (com.github.vimeo.vimeo-networking-java:models-parcelable:2.0.0-alpha.88)   
and jetified-models-serializable-2.0.0-alpha.88 (com.github.vimeo.vimeo-networking-java:models-serializable:2.0.0-alpha.88)  

It might be a problem on my side but I've never seen a similar error with any other libs.

I understand that releasing public versions of this library is not the main focus and I am willing to use the alpha versions as long as they work. If filing a support ticket might help to improve the situation, I'll gladly do it.

WhosNickDoglio commented 3 years ago

@wooodenleg What artifacts are you adding to your gradle file?

You should only need the the top level networking library (com.vimeo.networking:vimeo-networking:2.0.0-alpha.88) and and only one of the model artifacts (models, models-parcelable or models-serializable).

All three models artifacts are the same classes (which seems to be whats causing your error) but offer something a little different.

filwiesner commented 3 years ago

Well, since I thought that alpha versions are only on Jitpack, I am using only com.github.vimeo:vimeo-networking-java:2.0.0-alpha.88 artifact. I haven't noticed that there are others artifacts like models-parcelable so I didn't include them. It looks like that the Jitpack dependency includes the whole repo with all modules so I am actually depending on all of the models modules.
When I realized this I excluded models-parcelable and models-serializable dependencies and everything seems to work now.

For future reference I used:

repositories {
    // ...
    maven { url = uri("https://jitpack.io") }
}

dependencies {
    // ...
    implementation("com.github.vimeo:vimeo-networking-java:2.0.0-alpha.88") {
        exclude(module = "models-serializable")
        exclude(module = "models-parcelable")
    }
}

@WhosNickDoglio com.vimeo.networking:vimeo-networking:2.0.0-alpha.88 does not seem to work. I guess that would have to be on maven central but there is only the 1.1.3 version.