Bug report #3912

WMS Proxy username and password not working

Added by Tim Sutton about 18 years ago. Updated over 14 years ago.

Status:Closed
Priority:Low
Assignee:Brendan Morley -
Category:Web Services clients/WMS
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:13936

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.

History

#1 Updated by Gavin Macaulay - about 18 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

Fixed in 69c0c360 (SVN r5244)

#2 Updated by Brendan Morley - over 17 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (fixed)

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

#3 Updated by Brendan Morley - over 17 years ago

  • Status changed from Feedback to Open

Speculative fix in 07a42c17 (SVN r5698).

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

#4 Updated by Gavin Macaulay - over 17 years ago

With SVN 07a42c17 (SVN r5698), 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.

#5 Updated by Gavin Macaulay - over 17 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

#6 Updated by Brendan Morley - over 17 years ago

  • Status changed from Open to In Progress

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

#7 Updated by Brendan Morley - over 17 years ago

Correction: 18d27449 (SVN r5717) not 5715.

#8 Updated by Gavin Macaulay - over 17 years ago

More changes in SVN c14a0207 (SVN r5724) that should fix the problem. Needs a bit of testing though...

#9 Updated by Gavin Macaulay - over 17 years ago

  • Status changed from In Progress to Closed
  • Resolution set to fixed

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

#10 Updated by neteler-itc-it - over 17 years ago

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

#11 Updated by Anonymous over 14 years ago

Milestone Version 0.8 deleted

Also available in: Atom PDF