in reply to https through a proxy
Some time ago I had this same problem.
The reason for this error is that LWP don't support HTTPS over proxy properly. It establishes TCP connection to a proxy, then creates SSL connection over TCP, and then sends "CONNECT needed-host\r\n" request. With real-world proxies (that is, squid:-), correct sequence is: create TCP connection to proxy, send "CONNECT xyz\r\n", and only then establish SSL connection.
I had a patch for LWP somewhere, but it must be outdated by now. Mail me (igorash at mail.od.ua) and I'll send it to you.