Interesting problem.
LWP is using IO::Socket::SSL as backend for https which transparently uses IPv6 if available. But, with plain http LWP is only using IPv4 (Net::HTTP isa IO::Socket::INET).
Your SSL host probably resolves to an IPv6 address so IO::Socket::SSL will use it, but then you try this address with a socks4 proxy - and the socks4 protocol can only do IPv4.
So what can you do?
- use an Socks5 proxy in the hope that LWP::Protocol::https supports IPv6
- restrict IO::Socket::SSL to IPv4 by loading it with use IO::Socket::SSL 'inet4'. Note, that this must be done on the first import, e.g. perl -MIO::Socket::SSL=inet4 yourprogram.pl
- you might also try to enforce IPv4 with @LWP::Protocol::http::EXTRA_SOCK_OPTS=( Family => AF_INET );