unable to connect to ios app store servers
Dear friends, i have iphone 7 with IOS 11.2.6. Recently one of my friends bought an iPhone X but he was unable to connect to itunes & app store servers with his apple ID so he requested me to try my apple ID. With my ID the app store on iPhone X started working fine. Later i signed out of his iPhone but to my surprise after that i have been unable to connect to itunes & app store servers with any apple ID. I have tried everything available on internet; set time and date to automatic, did all kind of resets including factory reset but still no apple ID on my phone can connect to itunes & app store. I can connect to all other apple ID related services including iCloud and find my iPhone. I would be grateful if someone could help me out. All i can think of is that somehow my iPhone 's serial number or some other identity is being blocked by itunes. Any suggestions?
iPhone 7, iOS 11.2.6