Index: /applications/editors/josm/plugins/DirectUpload/build.xml
===================================================================
--- /applications/editors/josm/plugins/DirectUpload/build.xml	(revision 29718)
+++ /applications/editors/josm/plugins/DirectUpload/build.xml	(revision 29719)
@@ -5,5 +5,5 @@
     <property name="commit.message" value="applied JOSM Ticket 4498 (patch by ax) - oauth support for gpx upload (I accidentally committed parts of the path in [24236])"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="5053"/>
+    <property name="plugin.main.version" value="5587"/>
 
     <!-- Configure these properties (replace "..." accordingly).
Index: /applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java
===================================================================
--- /applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java	(revision 29718)
+++ /applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java	(revision 29719)
@@ -42,6 +42,8 @@
 import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
 import org.openstreetmap.josm.io.GpxWriter;
+import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.UrlLabel;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -96,5 +98,4 @@
 
     // Constants used when generating upload request
-    private static final String API_VERSION = "0.6";
     private static final String BOUNDARY = "----------------------------d10f7aa230e8";
     private static final String LINE_END = "\r\n";
@@ -285,8 +286,8 @@
 
         // Upload URL
-        URL url = new URL("http://www.openstreetmap.org/api/" + API_VERSION + "/gpx/create");
+        URL url = new URL(OsmApi.getOsmApi().getBaseUrl() + "gpx/create");
 
         // Set up connection and log in
-        HttpURLConnection c = (HttpURLConnection) url.openConnection();
+        HttpURLConnection c = Utils.openHttpConnection(url);
         c.setFixedLengthStreamingMode(contentLength);
         c.setConnectTimeout(15000);
