Opened 18 years ago

Closed 18 years ago

Last modified 15 years ago

#8 closed bug (fixed)

WMS Proxy username and password not working

Reported by: timlinux Owned by: morb_au
Priority: minor: annoyance Milestone:
Component: WMS Version: Trunk
Keywords: ogc ows wms proxy QHttp Cc: neteler@…
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

From http://logs.qgis.org/slogs/%23qgis.2006-03-22.log: "morb_au, I tested your proxy thing but it seems to forget user & pwd as soon as you close the connection setup box"

The error is possibly in QgsHttpTransaction or QgsServerSourceSelect.

Will either need to fix this up before 0.8 or hide the user/pass feature from the GUI until fixed for a future release.

Change History (12)

comment:1 by g_j_m, 18 years ago

Resolution: fixed
Status: newclosed

Fixed in r5243

comment:2 by morb_au, 18 years ago

Resolution: fixed
Status: closedreopened

Tested the HEAD version, WMS proxy is not working at all, and gives a sparse error message.

comment:3 by morb_au, 18 years ago

Owner: changed from morb_au to gsherman
Status: reopenednew

Speculative fix in r5697.

Can somebody please test with a proxy for me and report back, or build a Windows version for me so that I can test?

comment:4 by g_j_m, 18 years ago

With SVN r5697, access to a wms server through a proxy now works for me. I get a list of available layers, but never get an image. The Metadata tab in the resulting layer properties dialog has no text in the value column. It works fine without a proxy in place.

comment:5 by g_j_m, 18 years ago

Brendan,

The problem here is that the wms provider does not have the proxy information set. The temporary wms provider instance created in the qgsserversourceselect class has the proxy stuff set correctly, but the second instance of the wms provider that is created in the QgsRasterLayer class doesn't (and is the one that retrieves the actual map data). The layer data that is passed to the QgsRasterLayer constructor doesn't include the wms proxy information, so the provider uses it's defaults.

This patch shows what needs to be set, but it's just a hack to confirm that it solves the problem (which it does):

Index: qgsrasterlayer.cpp
===================================================================
--- qgsrasterlayer.cpp  (revision 5709)
+++ qgsrasterlayer.cpp  (working copy)
@@ -5036,6 +5036,9 @@
         {
           valid = true;
 
+         QgsWmsProvider* pp = (QgsWmsProvider*)(dataProvider);
+         pp->setProxy("www-proxy",80,"","");
+
           dataProvider->addLayers(layers, styles);
           dataProvider->setImageEncoding(format);
           dataProvider->setImageCrs(crs);

This patch just hard-wires the proxy information for all raster layers to the required settings for the proxy that I have acccess to. Obviously, it should really get the information from one of the parameters that is passed to the QgsRasterLayer constructor.

Gavin

comment:6 by morb_au, 18 years ago

Owner: changed from gsherman to morb_au
Status: newassigned

Potential fix in r5715 based on Gavin's comment of 08/19/06 06:33:52. Please have a test of it if possible and report back.

comment:7 by morb_au, 18 years ago

Correction: r5716 not 5715.

comment:8 by g_j_m, 18 years ago

More changes in SVN r5723 that should fix the problem. Needs a bit of testing though...

comment:9 by g_j_m, 18 years ago

Resolution: fixed
Status: assignedclosed

Seems to work fine now. Tested both with and without a proxy.

comment:10 by neteler@…, 18 years ago

Cc: neteler@… added

Hi,

proxy works now, great & thanks. But strangely you have to add 'http://' into the WMS URL (while not needed elsewhere).

It would be great if it worked without 'http://' in the WMS URL as well (for consistency).

Great job, Markus

comment:11 by anonymous, 17 years ago

Awaiting user input: unset
Must Fix for Release: No

comment:12 by (none), 15 years ago

Milestone: Version 0.8

Milestone Version 0.8 deleted

Note: See TracTickets for help on using tickets.