cURL error 7: Failed to connect to… and SELinux

SELinux does not allow to access outside from http process. If you call curl from in your codes(php etc). Curl will throw an error

“cURL error 7: Failed to connect to…”

To fix it real quick, just allow http run the following command

setsebool httpd_can_network_connect true

then restart apache service