in reply to Connecting to SSL socket with user/password

looks like in the SSL case you're creating an Authorization header but not a socket (where is the call to new IO::Socket::SSL?)

(by the way, as a matter of general principle it's better to do Foo->new(...) rather than new Foo(...) because while the latter often happens to work, it doesn't really parse the way you'd expect if you're used to the way things work in C++ and Java. but that's a nitpick)