<div dir="ltr">Ok - thanks.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 11 Feb 2022 at 17:38, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Le 11/02/2022 à 18:24, Paul Harwood a écrit :<br>
> I have an application that uses GDAL with Proj Networking set on.<br>
><br>
> This is a cross platform application. It works on some platforms but <br>
> on mac (for instance) I get runtime errors like this<br>
><br>
> GDAL failure (1) PROJ: Cannot open <br>
> <a href="https://cdn.proj.org/us_nga_egm96_15.tif" rel="noreferrer" target="_blank">https://cdn.proj.org/us_nga_egm96_15.tif</a>: error setting certificate <br>
> file: xxx/cacert.pem<br>
><br>
> Proj is looking in the wrong place for the cacert file - which is in <br>
> the proj search path. I would rather avoid using environment <br>
> variables (complicated). Is there a programmatic way to set the Proj <br>
> cacert location or a default location?<br>
><br>
> currently - the following are set<br>
><br>
><br>
> Gdal.SetConfigOption("CURL_CA_BUNDLE", Path.Combine(gdalData, <br>
> "cacert.pem"));<br>
<br>
The logic in PROJ is:<br>
<br>
// Custom path to SSL certificates.<br>
if (ca_bundle_path == nullptr) {<br>
ca_bundle_path = getenv("PROJ_CURL_CA_BUNDLE");<br>
}<br>
if (ca_bundle_path == nullptr) {<br>
// Name of environment variable used by the curl binary<br>
ca_bundle_path = getenv("CURL_CA_BUNDLE");<br>
}<br>
if (ca_bundle_path == nullptr) {<br>
// Name of environment variable used by the curl binary (tested<br>
// after CURL_CA_BUNDLE<br>
ca_bundle_path = getenv("SSL_CERT_FILE");<br>
}<br>
if (ca_bundle_path != nullptr) {<br>
CHECK_RET(ctx,<br>
curl_easy_setopt(handle, CURLOPT_CAINFO, <br>
ca_bundle_path));<br>
}<br>
<br>
There's no programmatic way, at least currently. You need to set a real <br>
environment variable . CPLSetConfigOption() has no effect on PROJ, only <br>
on GDAL<br>
<br>
<br>
> Osr.SetPROJSearchPath(projData);<br>
> Osr.SetPROJEnableNetwork(true);<br>
><br>
><br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
-- <br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
My software is free, but my time generally not.<br>
<br>
</blockquote></div>