Use a better way to restore https options