This is a bit of an edge case, but we have a number of people crashing in OkHttp 4.9.0 due to Conscrypt's version() call returning null. While I unfortunately don't have a repro, looking at Conscrypt's code, it seems this is a valid possibility, as per the code in Conscrypt.java line 112. That having been said, I realize this is an edge case, especially since these devices (Samsung/Motorola) are actually returning true for conscrypt being enabled, but null for the version.
Would it be possible to treat a null version as a signal for Conscrypt not being supported? Happy to open a PR if this is reasonable.
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int org.conscrypt.Conscrypt$Version.major()' on a null object reference
at okhttp3.internal.platform.ConscryptPlatform$Companion.atLeastVersion(ConscryptPlatform.java:129)
at okhttp3.internal.platform.ConscryptPlatform.<clinit>(ConscryptPlatform.java:115)
at okhttp3.internal.platform.android.ConscryptSocketAdapter$Companion$factory$1.matchesSocket(ConscryptSocketAdapter.java:58)
at okhttp3.internal.platform.android.DeferredSocketAdapter.matchesSocket(DeferredSocketAdapter.java:37)
at okhttp3.internal.platform.AndroidPlatform.configureTlsExtensions(AndroidPlatform.java:85)
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:375)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:337)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:209)
Yep. Want to send a pull request?
these devices (Samsung/Motorola) are actually returning true for conscrypt being enabled, but null for the version.
Presumably they return true because you explicitly include the Conscrypt dependency?
yes, it is being pulled in as a transitive dependency to one of the third party libraries we are using.