Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL certificate errors on API level 16-19 #721

Closed
ialokim opened this issue Oct 24, 2020 · 1 comment
Closed

SSL certificate errors on API level 16-19 #721

ialokim opened this issue Oct 24, 2020 · 1 comment
Labels
bug 🐞 A functional defect or unexpected behavior.

Comments

@ialokim
Copy link
Collaborator

ialokim commented Oct 24, 2020

Describe the bug
On my local emulator with API level 16 (minSdk), Transportr refuses to search for locations and nearby stations with the DB provider.

To Reproduce
Steps to reproduce the behavior:

  1. Select "DB" provider
  2. Search for nearby stations from some point (e.g. in Berlin) on the map
  3. Logcat reports the following:
10-24 15:56:15.520 4921-5031/de.grobox.liberario.debug I/de.grobox.transportr.locations.NearbyLocationsLoader: NearbyStation from (1000): Location{ADDRESS, 52.5198450/13.4073170, place=Berlin, name=Unnamed Road Unnamed Road}
10-24 15:56:15.760 4921-5031/de.grobox.liberario.debug W/System.err: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
10-24 15:56:15.770 4921-5031/de.grobox.liberario.debug W/System.err:     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:374)
10-24 15:56:15.780 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:320)
10-24 15:56:15.780 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:284)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:169)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:258)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
10-24 15:56:15.800 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:127)
10-24 15:56:15.810 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
10-24 15:56:15.810 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
10-24 15:56:15.810 4921-5031/de.grobox.liberario.debug W/System.err:     at de.schildbach.pte.util.HttpClient$2.intercept(HttpClient.java:112)
10-24 15:56:15.810 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
10-24 15:56:15.810 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
10-24 15:56:15.810 4921-5031/de.grobox.liberario.debug W/System.err:     at de.schildbach.pte.util.HttpClient$3.intercept(HttpClient.java:141)
10-24 15:56:15.810 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
10-24 15:56:15.810 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
10-24 15:56:15.810 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:257)
10-24 15:56:15.820 4921-5031/de.grobox.liberario.debug W/System.err:     at okhttp3.RealCall.execute(RealCall.java:93)
10-24 15:56:15.820 4921-5031/de.grobox.liberario.debug W/System.err:     at de.schildbach.pte.util.HttpClient.getInputStream(HttpClient.java:255)
10-24 15:56:15.820 4921-5031/de.grobox.liberario.debug W/System.err:     at de.schildbach.pte.util.HttpClient.get(HttpClient.java:205)
10-24 15:56:15.820 4921-5031/de.grobox.liberario.debug W/System.err:     at de.schildbach.pte.AbstractHafasClientInterfaceProvider.jsonLocGeoPos(AbstractHafasClientInterfaceProvider.java:242)
10-24 15:56:15.820 4921-5031/de.grobox.liberario.debug W/System.err:     at de.schildbach.pte.AbstractHafasClientInterfaceProvider.queryNearbyLocations(AbstractHafasClientInterfaceProvider.java:194)
10-24 15:56:15.820 4921-5031/de.grobox.liberario.debug W/System.err:     at de.grobox.transportr.locations.NearbyLocationsLoader.loadInBackground(NearbyLocationsLoader.java:62)
10-24 15:56:15.820 4921-5031/de.grobox.liberario.debug W/System.err:     at de.grobox.transportr.locations.NearbyLocationsLoader.loadInBackground(NearbyLocationsLoader.java:37)
10-24 15:56:15.820 4921-5031/de.grobox.liberario.debug W/System.err:     at androidx.loader.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307)
10-24 15:56:15.820 4921-5031/de.grobox.liberario.debug W/System.err:     at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
10-24 15:56:15.830 4921-5031/de.grobox.liberario.debug W/System.err:     at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48)
10-24 15:56:15.830 4921-5031/de.grobox.liberario.debug W/System.err:     at androidx.loader.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141)
10-24 15:56:15.830 4921-5031/de.grobox.liberario.debug W/System.err:     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-24 15:56:15.840 4921-5031/de.grobox.liberario.debug W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-24 15:56:15.840 4921-5031/de.grobox.liberario.debug W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-24 15:56:15.850 4921-5031/de.grobox.liberario.debug W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-24 15:56:15.850 4921-5031/de.grobox.liberario.debug W/System.err:     at java.lang.Thread.run(Thread.java:856)
10-24 15:56:15.850 4921-5031/de.grobox.liberario.debug W/System.err: Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
10-24 15:56:15.850 4921-5031/de.grobox.liberario.debug W/System.err:     at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:192)
10-24 15:56:15.870 4921-5031/de.grobox.liberario.debug W/System.err:     at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:163)
10-24 15:56:15.870 4921-5031/de.grobox.liberario.debug W/System.err:     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:573)
10-24 15:56:15.870 4921-5031/de.grobox.liberario.debug W/System.err:     at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method)
10-24 15:56:15.880 4921-5031/de.grobox.liberario.debug W/System.err:     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:371)
10-24 15:56:15.880 4921-5031/de.grobox.liberario.debug W/System.err: 	... 40 more
10-24 15:56:15.880 4921-5031/de.grobox.liberario.debug W/System.err: Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
10-24 15:56:15.890 4921-5031/de.grobox.liberario.debug W/System.err: 	... 45 more

While entering the name of some station (e.g. Berlin), the loading icon is shortly shown, but no results are presented in the drop-down menu. Neither logcat reports something nor does the application show some sort of error in this case.

As both features work as expected on the same installation with the "BVG" provider, I expect both problems to be related.

Expected behavior
The SSL certificates should be trusted and at least an error should be shown otherwise.

Versions (please complete the following information):

  • Transportr Version: 2.1.0
  • Device: emulator
  • Android Version: 4.1 (SDK version 16)
@ialokim ialokim added the bug 🐞 A functional defect or unexpected behavior. label Oct 24, 2020
@ialokim
Copy link
Collaborator Author

ialokim commented Oct 24, 2020

Same happens on API 19. Might be similar to or same as square/okhttp#2372

@ialokim ialokim changed the title SSL certificate errors on API level 16 SSL certificate errors on API level 16-19 Nov 7, 2021
@Altonss Altonss closed this as completed May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 A functional defect or unexpected behavior.
Projects
None yet
Development

No branches or pull requests

2 participants