It might be DNS Pollution issue, at least for my case (in China).
If you're also in China or some places that has DNS Pollution issue, you might solve this by modifying the DNS (to 8.8.8.8
as an example) for your Mac as well.
I got this error inner my iPad App & this happens randomly, it's such boring. Keep trying is not a good solution for me, though it might works somehow. Finally, I just changed my Wi-Fi DNS and no more error now. Steps:
8.8.8.8