I was re-downloading ROS2 Foxy from the documentation, in the step where we have to add the ROS 2 GPG key with apt, I am constantly getting error saying,
curl: (28) Failed to connect to raw.githubusercontent.com port 443: Connection timed out
That’s not a GPG key error, that’s an https connection timeout. Your connectivity to GitHub is causing the problem, which happens to be where the ROS GPG key is hosted.
Verify your connectivity to GitHub, maybe by pinging the host that the error message mentions.
I think ros2-foxy its not longer available, this month its the end of life for the foxy distro. You can try using humble or the newest one iron distribution.