Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9710 closed defect (fixed)

JOSM doesn't support https for talking to the API

Reported by: kakrueger@… Owned by: team
Priority: normal Milestone: 14.02
Component: Core Version:
Keywords: oauth Cc:

Description

Since today, OpenStreetMap supports SSL on the api calls[1]. Unfortunately it seems that josm doesn't support using SSL yet.

When entering https://api.openstreetmap.org/api as a custom API url, it trys to connect to https:/api.openstreetmap.org/api i.e. it somehow seems to drop the second "/" which then results in a connection refused error.

Tested with josm 6836

[1] http://blog.openstreetmap.org/2014/02/11/osm-enhances-user-privacy/

Attachments (0)

Change History (17)

comment:1 Changed 5 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 6840/josm:

fix #9710 - allow HTTPS access to OSM API

comment:2 Changed 5 years ago by Don-vip

Milestone: 14.02

comment:3 Changed 5 years ago by rickmastfan67

Resolution: fixed
Status: closedreopened

There still seems to be some bugs with this. It seems that you can't upload from JOSM with OAuth when running HTTPS. I'm testing this with [6842].

When I test my OAuth access token from inside of JOSM, it claims it's valid. However when I attempt to upload, JOSM says I can't be authenticated. So, I go back to the 'Connection Settings > Authentication' section in the preferences and click the "Display Advanced OAuth Parameters" box. In that, it shows 3 URLs and they all are directed to the 'HTTP' version of OSM, even though the OSM Server URL above is 'HTTPS'. So, I go manually change them so that they all are 'HTTPS' and hit the 'OK' button to save the changes.

I then try to upload again and I still get the message that I can't be authenticated. So, I now go back to the 'Connection Settings > Authentication' section again and click the "Display Advanced OAuth Parameters" box. What do I find? Well, JOSM didn't save my changes in the URLs and still displays the 'HTTP' version instead of the 'HTTPS'.

So, as far as I can tell, the OAuth part of JOSM doesn't like the 'HTTPS' urls. Hope this can be easily fixed and is not a bug on the OSM server side (which I don't think it is because of the token validating when not uploading without any problems).

INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/20519132...
INFO: OK
INFO: POST https://api.openstreetmap.org/api/0.6/changeset/20519132/upload...
INFO: Authorization Required
ERROR: Error body: Couldn't authenticate you

ERROR: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
        at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:711)
        at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:581)
        at org.openstreetmap.josm.io.OsmApi.uploadDiff(OsmApi.java:525)
        at org.openstreetmap.josm.io.OsmServerWriter.uploadChangesAsDiffUpload(OsmServerWriter.java:132)
        at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:208)
        at org.openstreetmap.josm.gui.io.UploadPrimitivesTask.realRun(UploadPrimitivesTask.java:250)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:150)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2014-02-12 09:36:32
Last Changed Author: akks
Revision: 6842
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2014-02-12 09:49:07 +0100 (Wed, 12 Feb 2014)
Last Changed Rev: 6842

Identification: JOSM/1.5 (6842 en) Windows 7 64-Bit
Memory Usage: 321 MB / 1820 MB (175 MB allocated, but free)
Java version: 1.7.0_51, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
VM arguments: [-Xmx2048M]
Dataset consistency test: No problems found

Plugin: ImageryCache (30277)
Plugin: OpeningHoursEditor (30235)
Plugin: buildings_tools (30277)
Plugin: measurement (30277)
Plugin: mirrored_download (30197)
Plugin: notes (v0.9.1)
Plugin: osmarender (30277)
Plugin: reverter (30277)
Plugin: turnrestrictions (30277)
Plugin: undelete (30277)
Plugin: utilsplugin2 (30277)

comment:4 Changed 5 years ago by Don-vip

Keywords: oauth added

comment:5 Changed 5 years ago by stoecker

Small fix, see r6845. Still does not work.

comment:6 Changed 5 years ago by Don-vip

In 6847/josm:

see #9710 - OAuth advanced parameters persistence

comment:7 Changed 5 years ago by Don-vip

One more fix, still does not work. I suspect a bug on OSM server side.

comment:8 in reply to:  7 Changed 5 years ago by Don-vip

Replying to Don-vip:

I suspect a bug on OSM server side.

Asked in https://trac.openstreetmap.org/ticket/5118

comment:9 Changed 5 years ago by Don-vip

It could also be a limitation of our OAuth library.

comment:10 Changed 5 years ago by stoecker

In 6849/josm:

see #9710 - update oauth library code

comment:11 Changed 5 years ago by rickmastfan67

Just tried again with the [6850] nightly and it still doesn't work, even with the changes made in [6849]. :( Got the same exact error message as I posted in comment:3.

comment:12 Changed 5 years ago by Don-vip

In 6851/josm:

see #9710 - enable OAuth debug output with --debug + single endpoint to change system properties

comment:13 Changed 5 years ago by Don-vip

In 6852/josm:

see #9710 - more debug messages

comment:14 Changed 5 years ago by rickmastfan67

How do I trigger the debug messages to show up?

---

On a side note, with the changes that have been done in the last 24h, the error message did change a tad, but only one line.

INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/20570120...
INFO: OK
INFO: POST https://api.openstreetmap.org/api/0.6/changeset/20570120/upload...
INFO: Authorization Required
ERROR: Error body: Couldn't authenticate you

ERROR: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
        at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:715)
        at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:581)
        at org.openstreetmap.josm.io.OsmApi.uploadDiff(OsmApi.java:525)
        at org.openstreetmap.josm.io.OsmServerWriter.uploadChangesAsDiffUpload(OsmServerWriter.java:132)
        at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:208)
        at org.openstreetmap.josm.gui.io.UploadPrimitivesTask.realRun(UploadPrimitivesTask.java:250)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:150)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Was:
at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:711)

Now:
at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:715)

comment:15 Changed 5 years ago by stoecker

Ticket #o5118 says it should be fixed on server side now.

P.S. we should fix the stripping of ' sign in error message.

comment:16 Changed 5 years ago by Don-vip

Resolution: fixed
Status: reopenedclosed

comment:17 Changed 5 years ago by rickmastfan67

Sorry, didn't get a chance to respond back sooner. But I've been having no problems with the https upload once the problem was fixed on the OSM server side.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.