Mercurial > hg > nginx-tests
comparison ssl_sni.t @ 243:de7338227832
Tests: removed trailing spaces.
author | Homutov Vladimir <vl@nginx.com> |
---|---|
date | Mon, 14 Jan 2013 16:57:50 +0400 |
parents | 90af19544dd2 |
children | 6072306b7924 |
comparison
equal
deleted
inserted
replaced
242:8f280348d76f | 243:de7338227832 |
---|---|
64 EOF | 64 EOF |
65 | 65 |
66 eval { require IO::Socket::SSL; die if $IO::Socket::SSL::VERSION < 1.56; }; | 66 eval { require IO::Socket::SSL; die if $IO::Socket::SSL::VERSION < 1.56; }; |
67 plan(skip_all => 'IO::Socket::SSL version >= 1.56 required') if $@; | 67 plan(skip_all => 'IO::Socket::SSL version >= 1.56 required') if $@; |
68 | 68 |
69 eval { | 69 eval { |
70 my $ctx = Net::SSLeay::CTX_new() or die; | 70 my $ctx = Net::SSLeay::CTX_new() or die; |
71 my $ssl = Net::SSLeay::new($ctx) or die; | 71 my $ssl = Net::SSLeay::new($ctx) or die; |
72 Net::SSLeay::set_tlsext_host_name($ssl, 'example.org') == 1 or die; | 72 Net::SSLeay::set_tlsext_host_name($ssl, 'example.org') == 1 or die; |
73 }; | 73 }; |
74 plan(skip_all => 'Net::SSLeay with OpenSSL SNI support required') if $@; | 74 plan(skip_all => 'Net::SSLeay with OpenSSL SNI support required') if $@; |
151 | 151 |
152 return $s->dump_peer_certificate(); | 152 return $s->dump_peer_certificate(); |
153 } | 153 } |
154 | 154 |
155 sub https_get_host { | 155 sub https_get_host { |
156 my ($host, $sni) = @_; | 156 my ($host, $sni) = @_; |
157 my $s = get_ssl_socket($sni ? $sni : $host); | 157 my $s = get_ssl_socket($sni ? $sni : $host); |
158 | 158 |
159 return http(<<EOF, socket => $s); | 159 return http(<<EOF, socket => $s); |
160 GET / HTTP/1.0 | 160 GET / HTTP/1.0 |
161 Host: $host | 161 Host: $host |