lembark has asked for the wisdom of the Perl Monks concerning the following question:
Q: Anyone have experience, or reference to a working example, of using IO::Socket::* to connect with this soft of a HTTP->HTTPS tunnel proxy?
thank you
IO-Socket-SSL-2.074.tar.gz
Homegrown perl-5.34.1.
RHEL6 for system lib's [yes, 6].
Looking at the tunnel portion I've tried several approaches shown in IO::Socket::SSL:curl --verbose 'https://foo.bar.net/bim/bam' * Trying 10.10.10.10... * Connected to 10.10.10.10 (10.10.10.10) port 80 (#0) * Establish HTTP proxy tunnel to foo.bar.net:443 > CONNECT foo.bar.net:443 HTTP/1.1 > Host: foo.bar.net:443 > User-Agent: curl/7.44.0 > Proxy-Connection: Keep-Alive > < HTTP/1.1 503 Service Unavailable < Cache-Control: no-cache < X-XSS-Protection: 1 < Connection: close < Content-Type: text/html; charset=utf-8 < Content-Length: 750 < Pragma: no-cache < Set-Cookie: frobnicate; path=/; Httponly < * Received HTTP code 503 from proxy after CONNECT * Closing connection 0 curl: (56) Received HTTP code 503 from proxy after CONNECT
Under "Talk Plain and SSL With The Same Socket"
Alternatives are turning a stock INET socket into an SSL:
Or starting the connection without SSL and going from there:my $sock = IO::Socket::INET->new(...) or die $!; IO::Socket::SSL->start_SSL($sock,%sslargs) or die $SSL_ERROR; $sock->stop_SSL or die $SSL_ERROR;
Both of these get me "connection reset by peer", maybe because the HTTP portion of the connection doesn't like the switchover to SSL.my $sock = IO::Socket::SSL->new( PeerAddr => ... SSL_startHandshake => 0, %sslargs ) or die $!;
Leaves me with a sigpipe.eval { my $sock = IO::Socket::INET->new( %http_argz ); IO::Socket::SSL->start_SSL ( $sock , %https_argz ); print $sock "GET / HTTP/1.0\r\n\r\n"; };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: IO::Socket::SSL with http proxy tunnel?
by roboticus (Chancellor) on Jun 16, 2022 at 03:42 UTC | |
Re: IO::Socket::SSL with http proxy tunnel?
by nikosv (Deacon) on Jun 26, 2022 at 12:54 UTC | |
Re: IO::Socket::SSL with http proxy tunnel?
by lembark (Novice) on Jun 15, 2022 at 19:18 UTC | |
by NERDVANA (Priest) on Jun 17, 2022 at 02:08 UTC |