OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 : SSLStreamAdapter(stream), | 27 : SSLStreamAdapter(stream), |
28 state_(SSL_NONE), | 28 state_(SSL_NONE), |
29 role_(SSL_CLIENT), | 29 role_(SSL_CLIENT), |
30 ssl_error_code_(0), // Not meaningful yet | 30 ssl_error_code_(0), // Not meaningful yet |
31 ssl_mode_(SSL_MODE_TLS), | 31 ssl_mode_(SSL_MODE_TLS), |
32 ssl_max_version_(SSL_PROTOCOL_TLS_11) { | 32 ssl_max_version_(SSL_PROTOCOL_TLS_11) { |
33 } | 33 } |
34 | 34 |
35 SSLStreamAdapterHelper::~SSLStreamAdapterHelper() = default; | 35 SSLStreamAdapterHelper::~SSLStreamAdapterHelper() = default; |
36 | 36 |
37 void SSLStreamAdapterHelper::SetIdentity(SSLIdentity* identity) { | 37 void SSLStreamAdapterHelper::SetCertificate( |
38 ASSERT(identity_.get() == NULL); | 38 const scoped_refptr<webrtc::DtlsCertificate>& dtlscert) { |
39 identity_.reset(identity); | 39 ASSERT(!dtlscertificate_.get()); |
| 40 dtlscertificate_ = dtlscert; |
40 } | 41 } |
41 | 42 |
42 void SSLStreamAdapterHelper::SetServerRole(SSLRole role) { | 43 void SSLStreamAdapterHelper::SetServerRole(SSLRole role) { |
43 role_ = role; | 44 role_ = role; |
44 } | 45 } |
45 | 46 |
46 int SSLStreamAdapterHelper::StartSSLWithServer(const char* server_name) { | 47 int SSLStreamAdapterHelper::StartSSLWithServer(const char* server_name) { |
47 ASSERT(server_name != NULL && server_name[0] != '\0'); | 48 ASSERT(server_name != NULL && server_name[0] != '\0'); |
48 ssl_server_name_ = server_name; | 49 ssl_server_name_ = server_name; |
49 return StartSSL(); | 50 return StartSSL(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 if (err) { | 137 if (err) { |
137 Error("BeginSSL", err, false); | 138 Error("BeginSSL", err, false); |
138 return err; | 139 return err; |
139 } | 140 } |
140 | 141 |
141 return 0; | 142 return 0; |
142 } | 143 } |
143 | 144 |
144 } // namespace rtc | 145 } // namespace rtc |
145 | 146 |
OLD | NEW |