I tried downloading a video using yt-dlp but got the following errors :
ERROR: [requests] Unexpected error: FileNotFoundError: [Errno 2] No such file or directory: '~/.ssl-log.key'; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U

ERROR: [urllib] Unexpected error: FileNotFoundError: [Errno 2] No such file or directory: '~/.ssl-log.key'; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U

ERROR: Unable to handle request: Unsupported url scheme: "https" (websockets) + 2 unexpected error(s)

After some troubleshooting, I found that I get a similar error when trying to download a package via pip FileNotFoundError: [Errno 2] No such file or directory: '~/.ssl-log.key'

I tried searching to see if I could regenerate ~/.ssl-log.key but couldn’t find anything. Does someone know what caused this issue and how to fix it?

Solved: for some reason SSLKEYLOGFILE was being set in my shell config, deleting and unsetting it fixed it