Error Retrieving DEM for Terrain Correction Snappy Python


So i am doing terrain correction using snappy python, when it’s on the process of retrieving dem i got error,
This how the code:

parameters = HashMap()
  parameters.put('demResamplingMethod', 'NEAREST_NEIGHBOUR')
  parameters.put('imgResamplingMethod', 'NEAREST_NEIGHBOUR')
  parameters.put('demName', 'SRTM 3Sec')
  parameters.put('pixelSpacingInMeter', 30.0)
  parameters.put('sourceBands', 'Sigma0_' + polarization)
  terrain = output + date + "_corrected_" + polarization
  target_2 = GPF.createProduct("Terrain-Correction", parameters, target_0)
  ProductIO.writeProduct(target_2, terrain, 'GeoTIFF-BigTIFF')

and here the error line:

INFO: org.esa.snap.core.dataop.dem.ElevationFile: http retrieving

WARNING: org.esa.snap.core.dataop.dem.ElevationFile: http error: on

WARNING: org.esa.s1tbx.sar.gpf.geometric.RangeDopplerGeocodingOp: Terrain-Correction$1679C8206DC error: no valid output was produced. Please verify the DEM

I also tried to use dem manually but still got error, so i replace parameter code

dempath = "dem.tif"
parameters.put('demName', dempath)

error line:
The DEM 'dem.tif' is not supported.

Thank You


[Solve external DEM]
For the last part i come to solve the problem as i see further into the documentation on ‘gpt -h’ as you can use parameter:
parameters.put('externalDEMFile', 'dempath')

The question I have now are:
When running the script, it seems it still tries to auto download DEM which still gives error as a pointed out. I assume when it failed to download DEM, the external DEM will be used.
So, can I skip the process of auto download DEM and just use the external DEM instead?

Thank You


The download service of SRTM data from CGIAR CSI has been updated in November.
The the download location of srtm_58_14 is

It might work if you change the URL in the file. It is located in the etc folder of the SNAP installation directory.
DEM.srtm3GeoTiffDEM_HTTP =
DEM.srtm3GeoTiffDEM_HTTP =