as a bash command running on the Moodle server? The latter is what I'm suggesting you try, in order to see if the Moodle server is firewalled to block outgoing HTTPS connections. Perhaps most ...