Hamer has spent the last four years contracted to the Foxes but the stopper has only ever acted as backup to Kasper Schmeichel.
The 30-year-old made eight appearances in all competitions during the most recent campaign but the former Charlton Athletic man has opted for a new challenge in Yorkshire.
"He is well known to Paul and also played with our first-team coach Andrew Hughes at Charlton Athletic and both have given him glowing references as a goalkeeper and as a person, which is very important to us.
"I've spoken with Ben and he arrives here wanting to play Premier League football, which is great for us all. Jonas Lossl had a fantastic first season at the Club and this further competition will bring even more out of everyone, which is ideal for me and the team."
Hamer will likely begin next season as deputy to Jonas Lossl.