added code to verify ssl sites more reliably