Whitley, 20, spent time on loan at South Shields last season, and made his Boro debut in the league opener against Atherton Collieries.
Manager Darren Kelly said: "Ryan is a hugely promising young goalkeeper who I know very well as myself and Michael Ingham brought him into the York City academy a number of years ago.
"He is a very good young goalkeeper who will strengthen us a great deal."
Keep up-to-date with our exclusive email newsletters.
Digital advertising by Minute Media
© Pitch Hero Ltd 2008-2021