fixed getSecureConnection after #1800

and 7ba6a06300f150bbd2818afb01070203a6ce0549