Add -k key in curl for credentials checking.
It need in case, when server redirects as on on httpS*
url and SSL sertificat is not signed.
Error from curl:
  Peer certificate cannot be authenticated with known CA certificates