Error in secret or public key callback: socket hangup

Since a few weeks I get an error when verifying JWT token. Not sure if it happens on line 67 or line 83. It’s unpredictable when it happens, sometimes it works sometimes it doesn’t.

If it doesn’t work, I get the following error: JsonWebTokenError: error in secret or public key callback: socket hangup.

I also don’t get any other info in the logs in auth0 itself, so I can’t give much more info than this.

PS I think the tags doesn’t really match the issue, but I couldn’t find any better tags.