#571 closed defect (fixed)
[WMS/WFS] Ability to specify a proxy for remote connections
Reported by: | dmorissette | Owned by: | aboudreault |
---|---|---|---|
Priority: | high | Milestone: | 5.2 release |
Component: | Documentation - MapServer | Version: | 4.1 |
Severity: | normal | Keywords: | |
Cc: | mapserver@…, bartvde@…, franck.villoin@…, tjmitchell@…, micheal.arnold@…, pierrick.brihaye@…, jcampanello@…, mko |
Description (last modified by )
We need the ability to specify a proxy when connecting to remote WMS/WFS servers.
This could possibly be added as layer metadata wms_proxy_*, but I wonder if we should instead create global configuration parameters inside the WEB object?
I never really worked in environments with proxies, so I wonder if it is safe to assume that when someone uses a proxy, then they use it for *all* their http connections and not only to get to specific hosts? i.e. is it a good idea to have a single global proxy setting in the web object in the mapfile or should this be local at the layer level?
Attachments (2)
Change History (38)
comment:2 by , 19 years ago
The production environments I have been in would only need to have a global proxy setting in the MAP file, not a per layer proxy setting.
comment:3 by , 19 years ago
Cc: | added |
---|
comment:4 by , 19 years ago
Milestone: | → 4.2 release |
---|
comment:5 by , 19 years ago
Cc: | added |
---|
comment:6 by , 19 years ago
Attention, we can imagine use Services WMS without proxy for certain layers in the Intranet, and others services WMS/WFS out of intranet use the proxy. But I use only one the proxy in my production environment.
comment:7 by , 19 years ago
Franck, what would happen in your case if you tried to access a WMS server from the intranet via the proxy? Would things still work?
comment:8 by , 19 years ago
No, it does not function. If I pass by my proxy, the addresses of my Intranet are not solved. By fixing the proxy in a permanent way in my navigator, I do not see any more the sites of my Intranet. Is it possible to define a global proxy parameter, and to make it active by layer if necessary? Franck
comment:10 by , 19 years ago
Cc: | added |
---|
comment:11 by , 19 years ago
I also need this functionality due to some relocation of our servers. Our proxy requires our username/password too! Ugh. Curl docs say: "NOTE2: libcurl respects the environment variables http_proxy, ftp_proxy, all_proxy etc, if any of those is set." Can this be used somehow as a quick workaround? Tyler
comment:12 by , 19 years ago
The libcurl tutorial talks about those environment variables as well. They must be lowercase, and the value is in the format "[protocol://][user:password@]machine[:port]". They also note that the "protocol://" part is simply ignored if present. (Proxies are always http). Tyler, I think the best way to go is for you to try this and let us know if that works.
comment:13 by , 18 years ago
Cc: | added |
---|
comment:14 by , 18 years ago
Milestone: | 4.4 release → FUTURE |
---|
Not in 4.4. Setting FUTURE target milsetone.
comment:15 by , 18 years ago
Cc: | added |
---|
comment:16 by , 18 years ago
I checked this by using SetEnv http_proxy in the Apache conf and all works fine! There is also an option in curl to exclude certain domains if needed. For my use this would be enough. I can't think of any situation in which you want per layer proxy url's.
comment:17 by , 17 years ago
Cc: | added |
---|
comment:18 by , 17 years ago
op_sys: | Linux → Windows XP |
---|
Hello, I'm a new MapServer user and I have a problem. I want to call a layer from a remote WMS but I can't because I have a problem whith the proxy. I have inserted the next line in httpd.conf file: SetEnv http_proxy "http://isas.vivienda.local:8080" And I have inserted in my map file: LAYER # MODIS WMS map from JPL NAME modis_jpl TYPE RASTER OFFSITE 0 0 0 STATUS OFF CONNECTIONTYPE WMS DEBUG ON CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?" METADATA "wms_srs" "EPSG:4326" "wms_name" "modis" "wms_server_version" "1.1.1" "wms_format" "image/jpeg" "wms_proxy_*" "isas.vivienda.local:8080" END PROJECTION "init=epsg:4326" END END # Modis WMS image ends here But I only get a temporary file with an autentification proxy problem. What am I doing bad? What more do I need? Thak you, Emilio
comment:19 by , 17 years ago
Emilio, this is a bug report, it is not the place to ask for support, I would suggest that you send your question to the mapserver-users list. If it turns out that better proxy support would solve your problem then the conclusions of the list discussion can be added in support to this bug later on. (Hint: also include a copy of the proxy error messages in your post to the list.)
comment:20 by , 15 years ago
Description: | modified (diff) |
---|---|
Milestone: | FUTURE → 5.2 release |
comment:21 by , 15 years ago
I've attached a patch which provides an initial implementation of the ability to specify proxying information, as well as HTTP authentication information for WMS layers. The implementation uses layer- and web-level metadata, as discussed on #mapserver.
The patch adds the following new metadata directives:
'wms_proxy_host' '192.168.2.10'
- can be specified as a hostname, dotted-quad, with optional port component (e.g. '192.168.2.10:8080')
'wms_proxy_port' '8080'
- if the port is not given above, can be specified with this metadata
'wms_proxy_type' 'http'
- supported types: 'http', 'socks5' (case insensitive)
'wms_proxy_auth_type' 'ntlm'
- supported types (case insensitive):
- basic
- digest
- ntlm
- any (the underlying http library picks the best among the options supported by the remote server)
- anysafe (the underlying http library picks only safe methods among the options supported by the remote server)
'wms_proxy_username' 'foo' 'wms_proxy_password' '{FF88CFDAAE1A5E33}'
- msEncrypt-style string supported; also accepts "naked" strings
'wms_auth_type' 'ntlm'
- same supported options as wms_proxy_auth_type
'wms_auth_username' 'foo1' 'wms_auth_password' '{FF88CFDAAE1A5E33}'
- msEncrypt-style string supported; also accepts "naked" strings
comment:22 by , 15 years ago
Owner: | changed from | to
---|
comment:23 by , 15 years ago
Component: | WMS Client → MapServer Documentation |
---|---|
Status: | new → assigned |
I have applied the patches to the dev trunk. If folks could please test and report back I'd appreciate it. I'm moving this to a documentation bug at this point.
Steve
follow-up: 26 comment:24 by , 15 years ago
comment:25 by , 15 years ago
by , 15 years ago
Attachment: | mapserver-curlversion.patch added |
---|
allow build against curl < 7.10.7 (e.g. RHEL3)
comment:27 by , 15 years ago
Using CURLOPT_PROXYAUTH is only available starting with curl 7.10.7. To allow building against earlier versions (e.g. RHEL3 comes with 7.10.6) I've created the above patch.
Additionally, the patch introduces a warning when using Mapserver build with curl that doesn't support setting the proxy auth type, but nevertheless supplying the wms_proxy_auth_type metadata in the mapfile. Perhaps this should be an error.
comment:28 by , 15 years ago
Applied the patch to build against Curl 7.10.6 and older, and also log an error to warn the user but without aborting the execution. The error will look as follows and will be trappable through the error stack, or visible in the DEBUG output:
[Tue Jul 8 14:00:28 2008].247322 msHTTPExecuteRequests(): HTTP request error. CURLOPT_PROXYAUTH not supported. Requires Curl 7.10.7 and up. *_proxy_auth_type setting ignored.
Leaving ticket open for documentation as per comment:23
comment:30 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:31 by , 15 years ago
Status: | new → assigned |
---|
comment:32 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
- added proxy metadata to WMS-clients howto doc
comment:33 by , 13 years ago
Cc: | added |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
CURLOPT_PROXYAUTH is not correctly set using libcurl 7.19.7 and MapServer 5.2.1 or 5.4.2 on Linux x86_64.
configure:11858: checking for curl-config configure:11884: checking for curl-config configure:11902: found /usr/local/bin/curl-config configure:11915: result: /usr/local/bin/curl-config configure:11934: result: found libcurl version 7.19.7 configure:11945: result: OGC WMS Client Connections enabled (-DUSE_WMS_LYR). configure:11951: result: OGC WFS Client Connections enabled (-DUSE_WFS_LYR).
But mapserv binary produces
CURLOPT_PROXYAUTH not supported. Requires Curl 7.10.7 and up. *_proxy_auth_type setting ignored.
error. Setting CURLOPT_PROXYAUTH manually works fine.
comment:34 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:35 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The curl proxy auth support has been fixed and committed in r9708.
comment:36 by , 12 years ago
It seems that we forgot to implement proxy support for WFS client layers... ticket #3982 has been created to address this.