Sentinel-2 terrain correction

you can convert L1C to L2A products using sen2cor and use an external DEM by modifying the parameters file L2A_GIPP.xml. It is described in the sen2cor manual and it was discussed in this thread: Sen2cor DEM usage