Skip to content

Commit fd50474

Browse files
committed
Tests: unbreak stream_ssl_realip.t with TLS 1.3.
1 parent c1c0a89 commit fd50474

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

stream_ssl_realip.t

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ use Socket qw/ $CRLF /;
1717
BEGIN { use FindBin; chdir($FindBin::Bin); }
1818

1919
use lib 'lib';
20-
use Test::Nginx;
21-
use Test::Nginx::Stream qw/ stream /;
20+
use Test::Nginx qw/ :DEFAULT http_end /;
2221

2322
###############################################################################
2423

@@ -128,14 +127,14 @@ like(pp_get(8088, "PROXY UNKNOWN TCP4 192.0.2.1 192.0.2.2 1234 5678${CRLF}"),
128127
sub pp_get {
129128
my ($port, $proxy) = @_;
130129

131-
my $s = stream(PeerPort => port($port));
132-
$s->write($proxy);
130+
my $s = IO::Socket::INET->new('127.0.0.1:' . port($port)) or return;
131+
http($proxy, start => 1, socket => $s);
133132

134133
eval {
135134
local $SIG{ALRM} = sub { die "timeout\n" };
136135
local $SIG{PIPE} = sub { die "sigpipe\n" };
137136
alarm(8);
138-
IO::Socket::SSL->start_SSL($s->{_socket},
137+
IO::Socket::SSL->start_SSL($s,
139138
SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(),
140139
SSL_error_trap => sub { die $_[1] }
141140
);
@@ -148,7 +147,7 @@ sub pp_get {
148147
return undef;
149148
}
150149

151-
return $s->read();
150+
http_end($s);
152151
}
153152

154153
###############################################################################

0 commit comments

Comments
 (0)