mapcache
mapcache copied to clipboard
Improve handling of key environment variables (as they do not work on Windows systems)
- this is a long reported issue (many tickets in MapServer codebase over a decade or more) where environment variables do not work on all Windows systems (no matter what the web server is)
- an example key environment variable, that is relied upon by the MapCache codebase is
CURL_CA_BUNDLE - MapCache in
/mapcache/lib/http.cfaces this same problem on Windows systems (MS4W has had to do various workarounds because of this, for years, for both MapCache and MapServer) - pull request https://github.com/MapServer/MapServer/pull/6304 enables use of that variable through the mapfile CONFIG parameter
- update: I wonder if we could have a new section in mapcache.xml named
<environment_variables>, and these would take precedence (use this value, otherwise use the one found at the system level).
Thoughts?
@jmckenna - where wre you able to pass the file path in CURL_CA_BUNDLE to cURL?
In MapServer we have the following line at https://github.com/MapServer/MapServer/blob/c862b04cf690091995df40139a6be77a2ff72bce/maphttp.c#L579
unchecked_curl_easy_setopt(http_handle, CURLOPT_CAINFO, pszCurlCABundle );
The XML approach sounds good. Alternatively the CPLGetConfigOption approach used in MapServer could be used.