[gdal-dev] GDAL - Python Bindings - CURL NETRC_FILE

Morgan Kerle morgankerle at gmail.com
Sun Mar 12 07:49:49 PDT 2023


I am trying to use the /vsicurl/ file hander to access a remote tiff 
file using basic auth. Is it possible to provide a alternate location

for a .netrc file via the Python bindings? I have attempted to use 
SetConfigOption("CPL_CURL_NETRC_FILE" "abs/file/path/to/.netrc").

This appears to correctly set the CURL_NETRC_FILE option, as CURL 
debugging output shows "Couldn't find host 
data.lpdaac.earthdatacloud.nasa.gov in the (nil) file; using defaults". 
However, it appears the file is not found / accessible by libcurl.

Any suggestions as to why this may be the case? I have already confirmed 
that the file exists and is accessible, and running CURL with the same 
parameters in bash works fine.

Regards,

Morgan



More information about the gdal-dev mailing list