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 26 matching lines...) Expand all Loading... |
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 | 46 |
| 47 // Revocation checking is not needed because we use self-signed |
| 48 // certs. Disable it so that SSL layer doesn't try to initialize |
| 49 // OCSP (OCSP works only on IO thread). |
| 50 ssl_config.rev_checking_enabled = false; |
| 51 |
47 // SSLClientSocket takes ownership of the adapter. | 52 // SSLClientSocket takes ownership of the adapter. |
48 net::HostPortPair host_and_port( | 53 net::HostPortPair host_and_port( |
49 ContentDescription::kChromotingContentName, 0); | 54 ContentDescription::kChromotingContentName, 0); |
50 net::SSLClientSocketContext context; | 55 net::SSLClientSocketContext context; |
51 context.cert_verifier = cert_verifier; | 56 context.cert_verifier = cert_verifier; |
52 net::SSLClientSocket* ssl_socket = | 57 net::SSLClientSocket* ssl_socket = |
53 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( | 58 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( |
54 socket, host_and_port, ssl_config, NULL, context); | 59 socket, host_and_port, ssl_config, NULL, context); |
55 return ssl_socket; | 60 return ssl_socket; |
56 } | 61 } |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 delete this; | 235 delete this; |
231 } | 236 } |
232 | 237 |
233 void JingleStreamConnector::NotifyError() { | 238 void JingleStreamConnector::NotifyError() { |
234 socket_.reset(); | 239 socket_.reset(); |
235 NotifyDone(NULL); | 240 NotifyDone(NULL); |
236 } | 241 } |
237 | 242 |
238 } // namespace protocol | 243 } // namespace protocol |
239 } // namespace remoting | 244 } // namespace remoting |
OLD | NEW |