improved ssl check