comparison ssl.t @ 1093:2b0ef67ab032

Tests: added test for $ssl_ciphers variable (ticket #870).
author Andrey Zelenkov <zelenkov@nginx.com>
date Mon, 12 Dec 2016 15:53:27 +0300
parents d0ec761774a5
children dd8f126afa32
comparison
equal deleted inserted replaced
1092:f72f43eda2a6 1093:2b0ef67ab032
63 location /id { 63 location /id {
64 return 200 "body $ssl_session_id"; 64 return 200 "body $ssl_session_id";
65 } 65 }
66 location /cipher { 66 location /cipher {
67 return 200 "body $ssl_cipher"; 67 return 200 "body $ssl_cipher";
68 }
69 location /ciphers {
70 return 200 "body $ssl_ciphers";
68 } 71 }
69 location /client_verify { 72 location /client_verify {
70 return 200 "body $ssl_client_verify"; 73 return 200 "body $ssl_client_verify";
71 } 74 }
72 location /protocol { 75 location /protocol {
188 191
189 my $ctx = new IO::Socket::SSL::SSL_Context( 192 my $ctx = new IO::Socket::SSL::SSL_Context(
190 SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(), 193 SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(),
191 SSL_session_cache_size => 100); 194 SSL_session_cache_size => 100);
192 195
193 $t->try_run('no ssl_client_s_dn_legacy')->plan(20); 196 $t->try_run('no ssl_ciphers')->plan(21);
194 197
195 ############################################################################### 198 ###############################################################################
196 199
197 like(get('/reuse', 8085), qr/^body \.$/m, 'shared initial session'); 200 like(get('/reuse', 8085), qr/^body \.$/m, 'shared initial session');
198 like(get('/reuse', 8085), qr/^body r$/m, 'shared session reused'); 201 like(get('/reuse', 8085), qr/^body r$/m, 'shared session reused');
230 # embedded variables 233 # embedded variables
231 234
232 like(get('/id', 8085), qr/^body \w{64}$/m, 'session id'); 235 like(get('/id', 8085), qr/^body \w{64}$/m, 'session id');
233 unlike(http_get('/id'), qr/body \w/, 'session id no ssl'); 236 unlike(http_get('/id'), qr/body \w/, 'session id no ssl');
234 like(get('/cipher', 8085), qr/^body [\w-]+$/m, 'cipher'); 237 like(get('/cipher', 8085), qr/^body [\w-]+$/m, 'cipher');
238
239 $s = get_ssl_socket(undef, 8085);
240 like(http_get('/ciphers', socket => $s), qr/^body [:\w-]+$/m, 'ciphers');
241
235 like(get('/client_verify', 8085), qr/^body NONE$/m, 'client verify'); 242 like(get('/client_verify', 8085), qr/^body NONE$/m, 'client verify');
236 like(get('/protocol', 8085), qr/^body (TLS|SSL)v(\d|\.)+$/m, 'protocol'); 243 like(get('/protocol', 8085), qr/^body (TLS|SSL)v(\d|\.)+$/m, 'protocol');
237 like(cert('/issuer', 8085), qr!^body CN=issuer:/CN=issuer$!m, 'issuer'); 244 like(cert('/issuer', 8085), qr!^body CN=issuer:/CN=issuer$!m, 'issuer');
238 like(cert('/subject', 8085), qr!^body CN=subject:/CN=subject$!m, 'subject'); 245 like(cert('/subject', 8085), qr!^body CN=subject:/CN=subject$!m, 'subject');
239 246