write to tempfile before copying contents to destination while streaming

handle SSL verification disabling in streaming requests