BIG Thank you .. I had the same problem in M8 as well..
I faced the same problem with my HTC One M8, and here is how I solved it for myself.
Go to Settings
Under Personal select Security
Scroll down to Credential Storage
Select "Clear ...
It works perfectly on mine , When you restart your phone hit airplane mode then toggle it off it will take a few seconds but will work amazing,
You're going to have to do this all the time if you reboot your phone.
Finally Problem Solved.!!...
I Rooted and Flashed the SuperStock-Rom V2.0 Rom (Nougat) from this thread on my S7 SM-G930W8 (Bell Canada)
but there is no network connection / No service.
I followed all the steps carefully.
when I try to flash the CSC from the late...
I Followed all steps untill step 11 where I have to reboot into the recovery.
here I am trying to reboot it but it stuck into that screen where it says: Entering Recovery... and the HTC logo and under it where there is the red writing .