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

Osmose Quest - can't download because of https->http redirect #383

Closed
amenk opened this issue Aug 15, 2022 · 9 comments
Closed

Osmose Quest - can't download because of https->http redirect #383

amenk opened this issue Aug 15, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@amenk
Copy link

amenk commented Aug 15, 2022

How to Reproduce
Enable Osmose quest
Does not show up

Expected Behavior
Quest appears

Versions affected
v45.1_ee / Android 12

Exception

08-15 20:29:36.023 15982 16003 I osmose  : downloading for bbox: BoundingBox(min=LatLon(latitude=8.95019282586578, longitude=38.7652587890625), max=LatLon(latitude=8.966471298599469, longitude=38.7762451171875)) using request https://osmose.openstreetmap.fr/en/issues/open.csv?zoom=17&item=xxxx&level=1&limit=500&bbox=38.7652587890625%2C8.95019282586578%2C38.7762451171875%2C8.966471298599469
08-15 20:29:36.232 15982 16003 E osmose  : exception: CLEARTEXT communication to osmose.openstreetmap.fr not permitted by network security policy
08-15 20:29:36.232 15982 16003 E osmose  : java.net.UnknownServiceException: CLEARTEXT communication to osmose.openstreetmap.fr not permitted by network security policy
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:164)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
08-15 20:29:36.232 15982 16003 E osmose  : 	at okhttp3.RealCall.execute(RealCall.java:81)
08-15 20:29:36.232 15982 16003 E osmose  : 	at de.westnordost.streetcomplete.quests.osmose.OsmoseDao.download(OsmoseDao.kt:45)
08-15 20:29:36.232 15982 16003 E osmose  : 	at de.westnordost.streetcomplete.data.download.Downloader$download$2$1$4.invokeSuspend(Downloader.kt:49)
08-15 20:29:36.232 15982 16003 E osmose  : 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
08-15 20:29:36.232 15982 16003 E osmose  : 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
08-15 20:29:36.232 15982 16003 E osmose  : 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
08-15 20:29:36.232 15982 16003 E osmose  : 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
08-15 20:29:36.232 15982 16003 E osmose  : 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
08-15 20:29:36.232 15982 16003 E osmose  : 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
@amenk amenk added the bug Something isn't working label Aug 15, 2022
@amenk
Copy link
Author

amenk commented Aug 15, 2022

In a normal webbrowser it downloads, but the osmose server is redirecting to from https tot http

This might be the solution - untested:
https://stackoverflow.com/a/62477085/288568

But I am wondering, if the redirect is intended (https://twitter.com/s3lf/status/1559234587561283594)

@amenk amenk changed the title Osmose Quest - can't download Osmose Quest - can't download because of https->http redirect Aug 15, 2022
@amenk
Copy link
Author

amenk commented Aug 16, 2022

Fixed.

image

I will make a PR.

@frodrigo
Copy link

Reported to Osmose-QA osm-fr/osmose-frontend#396

@Helium314
Copy link
Owner

Thanks for noticing and solving!
Though it would definitely be best to have Osmose API working with https again.

As far as I understand the solution would simply allow unnoticed redirects to http on all connections, and I would like to avoid that if possible...

@amenk
Copy link
Author

amenk commented Aug 18, 2022

Yep, agree.
Thanks for the fork :-)

@frodrigo
Copy link

We will fix the Osmose redirect.
But note the redirection is because you now need to use the API to get data (same data as before)

@Helium314
Copy link
Owner

Thanks!
I already noticed that URL for downloading CSV has changed from http://osmose.openstreetmap.fr/en/issues/open.csv to https://osmose.openstreetmap.fr/api/0.3/issues.csv

It's already changed in SC EE, but in not yet published version.

@frodrigo
Copy link

It is fixed on Osmose side now.

@Helium314
Copy link
Owner

Great, so the quest is usable again in old (+latest released) versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants