Download failed. cURL error 28: Connection timed out after x milliseconds in Wordpress

I’m trying to download some plugins from an external source and I’m getting this error in Wordpress, does anyone know how to fix it? Its also causing issues with Wordfence. I’ve kinda tried disabling mod security and the Wordfence firewall, but it still wouldn’t work.

make sure the server have connectivity with the remote server ( external source ), error seems to be related to firewall , also try to download the plugin via command line with utility like wget / curl etc… and see if the issue is still there…