Chromium Code Reviews| 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_stream_connector.h" | 5 #include "remoting/protocol/jingle_stream_connector.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "jingle/glue/channel_socket_adapter.h" | 8 #include "jingle/glue/channel_socket_adapter.h" |
| 9 #include "jingle/glue/pseudotcp_adapter.h" | 9 #include "jingle/glue/pseudotcp_adapter.h" |
| 10 #include "net/base/cert_status_flags.h" | 10 #include "net/base/cert_status_flags.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 net::SSLClientSocket* CreateSSLClientSocket( | 36 net::SSLClientSocket* CreateSSLClientSocket( |
| 37 net::StreamSocket* socket, const std::string& der_cert, | 37 net::StreamSocket* socket, const std::string& der_cert, |
| 38 net::CertVerifier* cert_verifier) { | 38 net::CertVerifier* cert_verifier) { |
| 39 net::SSLConfig ssl_config; | 39 net::SSLConfig ssl_config; |
| 40 | 40 |
| 41 // Certificate provided by the host doesn't need authority. | 41 // Certificate provided by the host doesn't need authority. |
| 42 net::SSLConfig::CertAndStatus cert_and_status; | 42 net::SSLConfig::CertAndStatus cert_and_status; |
| 43 cert_and_status.cert_status = net::CERT_STATUS_AUTHORITY_INVALID; | 43 cert_and_status.cert_status = net::CERT_STATUS_AUTHORITY_INVALID; |
| 44 cert_and_status.der_cert = der_cert; | 44 cert_and_status.der_cert = der_cert; |
| 45 ssl_config.allowed_bad_certs.push_back(cert_and_status); | 45 ssl_config.allowed_bad_certs.push_back(cert_and_status); |
| 46 ssl_config.rev_checking_enabled = false; | |
|
wtc
2011/08/23 01:49:21
You may want to add a comment (revocation checking
Sergey Ulanov
2011/08/23 17:34:51
Done.
| |
| 46 | 47 |
| 47 // SSLClientSocket takes ownership of the adapter. | 48 // SSLClientSocket takes ownership of the adapter. |
| 48 net::HostPortPair host_and_port( | 49 net::HostPortPair host_and_port( |
| 49 ContentDescription::kChromotingContentName, 0); | 50 ContentDescription::kChromotingContentName, 0); |
| 50 net::SSLClientSocketContext context; | 51 net::SSLClientSocketContext context; |
| 51 context.cert_verifier = cert_verifier; | 52 context.cert_verifier = cert_verifier; |
| 52 net::SSLClientSocket* ssl_socket = | 53 net::SSLClientSocket* ssl_socket = |
| 53 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( | 54 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( |
| 54 socket, host_and_port, ssl_config, NULL, context); | 55 socket, host_and_port, ssl_config, NULL, context); |
| 55 return ssl_socket; | 56 return ssl_socket; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 delete this; | 231 delete this; |
| 231 } | 232 } |
| 232 | 233 |
| 233 void JingleStreamConnector::NotifyError() { | 234 void JingleStreamConnector::NotifyError() { |
| 234 socket_.reset(); | 235 socket_.reset(); |
| 235 NotifyDone(NULL); | 236 NotifyDone(NULL); |
| 236 } | 237 } |
| 237 | 238 |
| 238 } // namespace protocol | 239 } // namespace protocol |
| 239 } // namespace remoting | 240 } // namespace remoting |
| OLD | NEW |