Does you machine have some sort of constraint in the outbound rules?
For example, in AWS you have all outbound traffic allowed by default in the security groups.
In Digital Ocean you use Firewalls, the default inbound rule is SSH and the default outbound rule is to Permit All Traffic.
Did you removed any of these outbound rules?
Things to consider:
- Where is your server hosted?
- What are the outbound rules?
- If you try to curl a site with https does it work?
- If you try to curl a site with http only (not https) does it work? (to know if the issue is in the SSL connection)
- Have you changed
/etc/resolv.conf or some similar file that deals with DNS?