Ticket #8 (closed bug: fixed)

Opened 7 years ago

Last modified 4 years ago

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@…
Platform Version: Platform: All
Must Fix for Release: No 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

Changed 7 years ago by g_j_m

  • status changed from new to closed
  • resolution set to fixed

Fixed in r5243

Changed 7 years ago by morb_au

  • status changed from closed to reopened
  • resolution fixed deleted

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

Changed 7 years ago by morb_au

  • owner changed from morb_au to gsherman
  • status changed from reopened to new

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?

Changed 7 years ago by g_j_m

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.

Changed 7 years ago by g_j_m

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

Changed 7 years ago by morb_au

  • owner changed from gsherman to morb_au
  • status changed from new to assigned

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.

Changed 7 years ago by morb_au

Correction: r5716 not 5715.

Changed 7 years ago by g_j_m

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

Changed 7 years ago by g_j_m

  • status changed from assigned to closed
  • resolution set to fixed

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

Changed 7 years ago by neteler@…

  • 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

Changed 6 years ago by anonymous

  • status_info unset
  • must_fix set to No

Changed 4 years ago by anonymous

  • milestone Version 0.8 deleted

Milestone Version 0.8 deleted

Note: See TracTickets for help on using tickets.