Improved the SSL check and added debugging output to Net::HTTP when the debug option is set