There are lots of possible problems or misconfigurations, so we'll need more info. In particular:
- the exact prometheus error output
- the scrape job configuration
- the curl command you're using
- the response to the curl command (also, try putting "time" in front of the curl command, to measure how long it takes)
Are you running the curl command on the same host or container where prometheus itself is running? If not, then do so. It could be a network connectivity problem, or firewalling, between prometheus and the target.
If the scrape is not over https, then you may be able to find out more by using tcpdump on the prometheus server:
tcpdump -i eth0 -nn -s0 -A host x.x.x.x
(replace eth0 with correct interface name, replace x.x.x.x with target IP address)