I want to turn off find my iPhone but it give the message. There was an error connecting to iCloud.

I want to off find my iPhone but it give the message. There was an error connecting to iCloud.
You have to enter your iCloud passcode in order to disable the Find My iPhone feature. Apple wants to make sure that it doesn't make it easy for a thief to take control of a stolen iPhone.

Original thread: https://forums.imore.com/threads/i-want-to-turn-off-find-my-iphone-but-it-give-the-message-there-was-an-error-connecting-to-icloud.380513/