How to resolve "Cannot connect to AppleID server" error on macOS?
So if you can log into your Apple ID from a browser an incorrect time zone settings might cause an error in connecting your Apple ID with the Store.
To correct your time and date settings, go to Settings &gt; General &gt; Date &amp; Time and make sure that everything is set correctly.
Now: Open iTunes
Click on iTunes in the Menu Bar.
Select Preferences.

Go to the Advanced Tab.
Click the Reset Cache button.
Click OK.
Close and re-open iTunes.
Now, try to sign in to the iTunes store.