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 // TODO(ukai): code is similar with http_network_transaction.cc. We should | 5 // TODO(ukai): code is similar with http_network_transaction.cc. We should |
6 // think about ways to share code, if possible. | 6 // think about ways to share code, if possible. |
7 | 7 |
8 #include "net/socket_stream/socket_stream.h" | 8 #include "net/socket_stream/socket_stream.h" |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 ssl_config->IsAllowedBadCert(ssl_info.cert, NULL)) { | 328 ssl_config->IsAllowedBadCert(ssl_info.cert, NULL)) { |
329 // If we already have the certificate in the set of allowed bad | 329 // If we already have the certificate in the set of allowed bad |
330 // certificates, we did try it and failed again, so we should not | 330 // certificates, we did try it and failed again, so we should not |
331 // retry again: the connection should fail at last. | 331 // retry again: the connection should fail at last. |
332 next_state_ = STATE_CLOSE; | 332 next_state_ = STATE_CLOSE; |
333 return result; | 333 return result; |
334 } | 334 } |
335 // Add the bad certificate to the set of allowed certificates in the | 335 // Add the bad certificate to the set of allowed certificates in the |
336 // SSL config object. | 336 // SSL config object. |
337 SSLConfig::CertAndStatus bad_cert; | 337 SSLConfig::CertAndStatus bad_cert; |
338 if (!ssl_info.cert->GetDEREncoded(&bad_cert.der_cert)) { | 338 if (!X509Certificate::GetDEREncoded(ssl_info.cert->os_cert_handle(), |
| 339 &bad_cert.der_cert)) { |
339 next_state_ = STATE_CLOSE; | 340 next_state_ = STATE_CLOSE; |
340 return result; | 341 return result; |
341 } | 342 } |
342 bad_cert.cert_status = ssl_info.cert_status; | 343 bad_cert.cert_status = ssl_info.cert_status; |
343 ssl_config->allowed_bad_certs.push_back(bad_cert); | 344 ssl_config->allowed_bad_certs.push_back(bad_cert); |
344 // Restart connection ignoring the bad certificate. | 345 // Restart connection ignoring the bad certificate. |
345 socket_->Disconnect(); | 346 socket_->Disconnect(); |
346 socket_.reset(); | 347 socket_.reset(); |
347 next_state_ = STATE_TCP_CONNECT; | 348 next_state_ = STATE_TCP_CONNECT; |
348 return OK; | 349 return OK; |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 | 1180 |
1180 SSLConfigService* SocketStream::ssl_config_service() const { | 1181 SSLConfigService* SocketStream::ssl_config_service() const { |
1181 return context_->ssl_config_service(); | 1182 return context_->ssl_config_service(); |
1182 } | 1183 } |
1183 | 1184 |
1184 ProxyService* SocketStream::proxy_service() const { | 1185 ProxyService* SocketStream::proxy_service() const { |
1185 return context_->proxy_service(); | 1186 return context_->proxy_service(); |
1186 } | 1187 } |
1187 | 1188 |
1188 } // namespace net | 1189 } // namespace net |
OLD | NEW |