Using -k or --insecure with curl disables certificate validation.
Remove -k/--insecure from curl commands. Fix the TLS certificate instead.