| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "remoting/protocol/jingle_session.h" | 5 #include "remoting/protocol/jingle_session.h" |
| 6 | 6 |
| 7 #include "base/crypto/rsa_private_key.h" | 7 #include "base/crypto/rsa_private_key.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "net/base/cert_status_flags.h" |
| 9 #include "net/base/cert_verifier.h" | 10 #include "net/base/cert_verifier.h" |
| 10 #include "net/base/host_port_pair.h" | 11 #include "net/base/host_port_pair.h" |
| 11 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 12 #include "net/base/ssl_config_service.h" | 13 #include "net/base/ssl_config_service.h" |
| 13 #include "net/base/x509_certificate.h" | 14 #include "net/base/x509_certificate.h" |
| 14 #include "net/socket/client_socket_factory.h" | 15 #include "net/socket/client_socket_factory.h" |
| 15 #include "net/socket/ssl_client_socket.h" | 16 #include "net/socket/ssl_client_socket.h" |
| 16 #include "net/socket/ssl_server_socket.h" | 17 #include "net/socket/ssl_server_socket.h" |
| 17 #include "remoting/base/constants.h" | 18 #include "remoting/base/constants.h" |
| 18 #include "remoting/jingle_glue/channel_socket_adapter.h" | 19 #include "remoting/jingle_glue/channel_socket_adapter.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 net::ClientSocket* socket, scoped_refptr<net::X509Certificate> cert, | 53 net::ClientSocket* socket, scoped_refptr<net::X509Certificate> cert, |
| 53 net::CertVerifier* cert_verifier) { | 54 net::CertVerifier* cert_verifier) { |
| 54 net::SSLConfig ssl_config; | 55 net::SSLConfig ssl_config; |
| 55 ssl_config.false_start_enabled = false; | 56 ssl_config.false_start_enabled = false; |
| 56 ssl_config.snap_start_enabled = false; | 57 ssl_config.snap_start_enabled = false; |
| 57 ssl_config.ssl3_enabled = true; | 58 ssl_config.ssl3_enabled = true; |
| 58 ssl_config.tls1_enabled = true; | 59 ssl_config.tls1_enabled = true; |
| 59 | 60 |
| 60 // Certificate provided by the host doesn't need authority. | 61 // Certificate provided by the host doesn't need authority. |
| 61 net::SSLConfig::CertAndStatus cert_and_status; | 62 net::SSLConfig::CertAndStatus cert_and_status; |
| 62 cert_and_status.cert_status = net::ERR_CERT_AUTHORITY_INVALID; | 63 cert_and_status.cert_status = net::CERT_STATUS_AUTHORITY_INVALID; |
| 63 cert_and_status.cert = cert; | 64 cert_and_status.cert = cert; |
| 64 ssl_config.allowed_bad_certs.push_back(cert_and_status); | 65 ssl_config.allowed_bad_certs.push_back(cert_and_status); |
| 65 | 66 |
| 66 // SSLClientSocket takes ownership of the adapter. | 67 // SSLClientSocket takes ownership of the adapter. |
| 67 net::HostPortPair host_and_pair(JingleSession::kChromotingContentName, 0); | 68 net::HostPortPair host_and_pair(JingleSession::kChromotingContentName, 0); |
| 68 net::SSLClientSocket* ssl_socket = | 69 net::SSLClientSocket* ssl_socket = |
| 69 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( | 70 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( |
| 70 socket, host_and_pair, ssl_config, NULL, cert_verifier); | 71 socket, host_and_pair, ssl_config, NULL, cert_verifier); |
| 71 return ssl_socket; | 72 return ssl_socket; |
| 72 } | 73 } |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 | 520 |
| 520 state_ = new_state; | 521 state_ = new_state; |
| 521 if (!closed_ && state_change_callback_.get()) | 522 if (!closed_ && state_change_callback_.get()) |
| 522 state_change_callback_->Run(new_state); | 523 state_change_callback_->Run(new_state); |
| 523 } | 524 } |
| 524 } | 525 } |
| 525 | 526 |
| 526 } // namespace protocol | 527 } // namespace protocol |
| 527 | 528 |
| 528 } // namespace remoting | 529 } // namespace remoting |
| OLD | NEW |