The 23-year-old had a hugely successful loan spell with the Seadogs during the 2021/22 season, keeping 20 clean sheets as they were promoted to the National League North.
Whitley, a product of the York City academy, made 16 National League appearances for City last season while covering for the injured Ethan Ross.
The York man put on some impressive displays during the late stages of the 2022/23 season as the Minstermen fought for National League survival.
The move is subject to FA and National League approval.