Added SSL conditional check