redirect causes ssl cert error