Skip to content

Commit

Permalink
Making it possible to use IPv6 in https call through https proxy envi…
Browse files Browse the repository at this point in the history
…ronment (in case of using CONNECT method to create a tunnel)
  • Loading branch information
justnoxx authored and oalders committed Jan 22, 2024
1 parent 51ea5de commit 6e9101b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/LWP/Protocol/https.pm
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ sub _get_sock_info
if ( $Net::HTTPS::SSL_SOCKET_CLASS->can('start_SSL')) {
*_upgrade_sock = sub {
my ($self,$sock,$url) = @_;
# SNI should be passed there only if it is not an IP address.
# Details: https://github.com/libwww-perl/libwww-perl/issues/449#issuecomment-1896175509
my $host = $url->host_port() =~ m/:|^[\d.]+$/s ? () : $url->host();
$sock = LWP::Protocol::https::Socket->start_SSL( $sock,
SSL_verifycn_name => $url->host,
SSL_hostname => $url->host,
SSL_hostname => $host,
$self->_extra_sock_opts,
);
$@ = LWP::Protocol::https::Socket->errstr if ! $sock;
Expand Down

0 comments on commit 6e9101b

Please sign in to comment.