|
267 | 267 | + return serf_request_bucket_request_create_for_host( |
268 | 268 | + request, method, uri, body, allocator, NULL); |
269 | 269 | +} |
270 | | ---- serf/src/buckets/ssl_buckets.c 2012-08-29 13:52:29.443913000 -0400 |
271 | | -+++ src/third_party/serf/instaweb_ssl_buckets.c 2013-05-14 09:56:37.292605000 -0400 |
| 270 | +--- serf/src/buckets/ssl_buckets.c 2012-08-29 13:29:42.000000000 -0400 |
| 271 | ++++ src/third_party/serf/instaweb_ssl_buckets.c 2015-07-27 10:56:12.000000000 -0400 |
272 | 272 | @@ -34,6 +34,11 @@ |
273 | 273 | * Originally developed by Aaron Bannert and Justin Erenkrantz, eBuilt. |
274 | 274 | */ |
|
281 | 281 | #include <apr_pools.h> |
282 | 282 | #include <apr_network_io.h> |
283 | 283 | #include <apr_portable.h> |
284 | | -@@ -1160,7 +1165,9 @@ |
| 284 | +@@ -873,7 +878,9 @@ |
| 285 | + #if APR_HAS_THREADS |
| 286 | + int i, numlocks; |
| 287 | + #endif |
| 288 | ++#ifndef OPENSSL_IS_BORINGSSL |
| 289 | + CRYPTO_malloc_init(); |
| 290 | ++#endif |
| 291 | + ERR_load_crypto_strings(); |
| 292 | + SSL_load_error_strings(); |
| 293 | + SSL_library_init(); |
| 294 | +@@ -971,8 +978,13 @@ |
| 295 | + else { |
| 296 | + int err = ERR_get_error(); |
| 297 | + ERR_clear_error(); |
| 298 | ++#ifndef OPENSSL_IS_BORINGSSL |
| 299 | + if (ERR_GET_LIB(err) == ERR_LIB_PKCS12 && |
| 300 | + ERR_GET_REASON(err) == PKCS12_R_MAC_VERIFY_FAILURE) { |
| 301 | ++#else |
| 302 | ++ if (ERR_GET_LIB(err) == ERR_LIB_PKCS8 && |
| 303 | ++ ERR_GET_REASON(err) == PKCS8_R_INCORRECT_PASSWORD) { |
| 304 | ++#endif |
| 305 | + if (ctx->cert_pw_callback) { |
| 306 | + const char *password; |
| 307 | + |
| 308 | +@@ -1102,6 +1114,8 @@ |
| 309 | + ssl_ctx->allocator = allocator; |
| 310 | + |
| 311 | + ssl_ctx->ctx = SSL_CTX_new(SSLv23_client_method()); |
| 312 | ++ /* Use the best possible protocol version, but disable the broken SSLv2/3 */ |
| 313 | ++ SSL_CTX_set_options(ssl_ctx->ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); |
| 314 | + |
| 315 | + SSL_CTX_set_client_cert_cb(ssl_ctx->ctx, ssl_need_client_cert); |
| 316 | + ssl_ctx->cached_cert = 0; |
| 317 | +@@ -1160,7 +1174,9 @@ |
285 | 318 |
|
286 | 319 | /* SSL_free implicitly frees the underlying BIO. */ |
287 | 320 | SSL_free(ssl_ctx->ssl); |
|
291 | 324 |
|
292 | 325 | p = ssl_ctx->pool; |
293 | 326 |
|
294 | | -@@ -1209,6 +1216,28 @@ |
| 327 | +@@ -1193,7 +1209,9 @@ |
| 328 | + const char * hostname) |
| 329 | + { |
| 330 | + #ifdef SSL_set_tlsext_host_name |
| 331 | +- if (SSL_set_tlsext_host_name(context->ssl, hostname) != 1) { |
| 332 | ++ if (!context->ssl) { |
| 333 | ++ return APR_EGENERAL; |
| 334 | ++ } else if (SSL_set_tlsext_host_name(context->ssl, hostname) != 1) { |
| 335 | + ERR_clear_error(); |
| 336 | + } |
| 337 | + #endif |
| 338 | +@@ -1209,6 +1227,28 @@ |
295 | 339 | return result ? APR_SUCCESS : APR_EGENERAL; |
296 | 340 | } |
297 | 341 |
|
|
320 | 364 | apr_status_t serf_ssl_load_cert_file( |
321 | 365 | serf_ssl_certificate_t **cert, |
322 | 366 | const char *file_path, |
323 | | -@@ -1527,6 +1556,7 @@ |
| 367 | +@@ -1527,6 +1567,7 @@ |
324 | 368 |
|
325 | 369 | if (!--ctx->ssl_ctx->refcount) { |
326 | 370 | ssl_free_context(ctx->ssl_ctx); |
|
0 commit comments