Mercurial > hg > nginx-vendor-0-7
comparison src/http/ngx_http_request.c @ 196:8759b346e431 NGINX_0_3_45
nginx 0.3.45
*) Feature: the "ssl_verify_client", "ssl_verify_depth", and
"ssl_client_certificate" directives.
*) Change: the $request_method variable now returns the main request
method.
*) Change: the ° symbol codes were changed in koi-win conversion
table.
*) Feature: the euro É N symbols were added to koi-win conversion table.
*) Bugfix: if nginx distributed the requests among several backends and
some backend failed, then requests intended for this backend was
directed to one live backend only instead of being distributed among
the rest.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Sat, 06 May 2006 00:00:00 +0400 |
parents | 003bd800ec2a |
children | e6da4931e0e0 |
comparison
equal
deleted
inserted
replaced
195:b65e20aebc10 | 196:8759b346e431 |
---|---|
1170 | 1170 |
1171 | 1171 |
1172 static ngx_int_t | 1172 static ngx_int_t |
1173 ngx_http_process_request_header(ngx_http_request_t *r) | 1173 ngx_http_process_request_header(ngx_http_request_t *r) |
1174 { | 1174 { |
1175 size_t len; | 1175 size_t len; |
1176 u_char *ua, *user_agent, ch; | 1176 u_char *ua, *user_agent, ch; |
1177 #if (NGX_HTTP_SSL) | |
1178 long rc; | |
1179 ngx_http_ssl_srv_conf_t *sscf; | |
1180 #endif | |
1177 | 1181 |
1178 if (r->headers_in.host) { | 1182 if (r->headers_in.host) { |
1179 for (len = 0; len < r->headers_in.host->value.len; len++) { | 1183 for (len = 0; len < r->headers_in.host->value.len; len++) { |
1180 ch = r->headers_in.host->value.data[len]; | 1184 ch = r->headers_in.host->value.data[len]; |
1181 | 1185 |
1240 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, | 1244 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, |
1241 "client sent plain HTTP request to HTTPS port"); | 1245 "client sent plain HTTP request to HTTPS port"); |
1242 ngx_http_finalize_request(r, NGX_HTTP_TO_HTTPS); | 1246 ngx_http_finalize_request(r, NGX_HTTP_TO_HTTPS); |
1243 return NGX_ERROR; | 1247 return NGX_ERROR; |
1244 } | 1248 } |
1249 | |
1250 #if (NGX_HTTP_SSL) | |
1251 | |
1252 if (r->connection->ssl) { | |
1253 sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); | |
1254 | |
1255 if (sscf->verify) { | |
1256 rc = SSL_get_verify_result(r->connection->ssl->connection); | |
1257 | |
1258 if (rc != X509_V_OK) { | |
1259 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, | |
1260 "client SSL certificate verify error: %l ", rc); | |
1261 ngx_http_finalize_request(r, NGX_HTTPS_CERT_ERROR); | |
1262 return NGX_ERROR; | |
1263 } | |
1264 | |
1265 if (SSL_get_peer_certificate(r->connection->ssl->connection) | |
1266 == NULL) | |
1267 { | |
1268 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, | |
1269 "client sent no required SSL certificate"); | |
1270 ngx_http_finalize_request(r, NGX_HTTPS_NO_CERT); | |
1271 return NGX_ERROR; | |
1272 } | |
1273 } | |
1274 } | |
1275 | |
1276 #endif | |
1245 | 1277 |
1246 if (r->headers_in.connection) { | 1278 if (r->headers_in.connection) { |
1247 if (r->headers_in.connection->value.len == 5 | 1279 if (r->headers_in.connection->value.len == 5 |
1248 && ngx_strcasecmp(r->headers_in.connection->value.data, "close") | 1280 && ngx_strcasecmp(r->headers_in.connection->value.data, "close") |
1249 == 0) | 1281 == 0) |