OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // OpenSSL binding for SSLClientSocket. The class layout and general principle | 5 // OpenSSL binding for SSLClientSocket. The class layout and general principle |
6 // of operation is derived from SSLClientSocketNSS. | 6 // of operation is derived from SSLClientSocketNSS. |
7 | 7 |
8 #include "net/socket/ssl_client_socket_openssl.h" | 8 #include "net/socket/ssl_client_socket_openssl.h" |
9 | 9 |
10 #include <openssl/ssl.h> | 10 #include <openssl/ssl.h> |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 477 |
478 // TODO(joth): Set this conditionally, see http://crbug.com/55410 | 478 // TODO(joth): Set this conditionally, see http://crbug.com/55410 |
479 options.ConfigureFlag(SSL_OP_LEGACY_SERVER_CONNECT, true); | 479 options.ConfigureFlag(SSL_OP_LEGACY_SERVER_CONNECT, true); |
480 | 480 |
481 SSL_set_options(ssl_, options.set_mask); | 481 SSL_set_options(ssl_, options.set_mask); |
482 SSL_clear_options(ssl_, options.clear_mask); | 482 SSL_clear_options(ssl_, options.clear_mask); |
483 | 483 |
484 // Same as above, this time for the SSL mode. | 484 // Same as above, this time for the SSL mode. |
485 SslSetClearMask mode; | 485 SslSetClearMask mode; |
486 | 486 |
487 #if defined(SSL_MODE_HANDSHAKE_CUTTHROUGH) | |
488 mode.ConfigureFlag(SSL_MODE_HANDSHAKE_CUTTHROUGH, | |
489 ssl_config_.false_start_enabled && | |
490 !SSLConfigService::IsKnownFalseStartIncompatibleServer( | |
491 host_and_port_.host())); | |
492 #endif | |
493 | |
494 #if defined(SSL_MODE_RELEASE_BUFFERS) | 487 #if defined(SSL_MODE_RELEASE_BUFFERS) |
495 mode.ConfigureFlag(SSL_MODE_RELEASE_BUFFERS, true); | 488 mode.ConfigureFlag(SSL_MODE_RELEASE_BUFFERS, true); |
496 #endif | 489 #endif |
497 | 490 |
498 #if defined(SSL_MODE_SMALL_BUFFERS) | 491 #if defined(SSL_MODE_SMALL_BUFFERS) |
499 mode.ConfigureFlag(SSL_MODE_SMALL_BUFFERS, true); | 492 mode.ConfigureFlag(SSL_MODE_SMALL_BUFFERS, true); |
500 #endif | 493 #endif |
501 | 494 |
502 SSL_set_mode(ssl_, mode.set_mask); | 495 SSL_set_mode(ssl_, mode.set_mask); |
503 SSL_clear_mode(ssl_, mode.clear_mask); | 496 SSL_clear_mode(ssl_, mode.clear_mask); |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, | 1293 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, |
1301 user_write_buf_->data()); | 1294 user_write_buf_->data()); |
1302 return rv; | 1295 return rv; |
1303 } | 1296 } |
1304 | 1297 |
1305 int err = SSL_get_error(ssl_, rv); | 1298 int err = SSL_get_error(ssl_, rv); |
1306 return MapOpenSSLError(err, err_tracer); | 1299 return MapOpenSSLError(err, err_tracer); |
1307 } | 1300 } |
1308 | 1301 |
1309 } // namespace net | 1302 } // namespace net |
OLD | NEW |