improved SSL validation