OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 rtc::scoped_ptr<rtc::SSLAdapter> ssl_adapter_; | 125 rtc::scoped_ptr<rtc::SSLAdapter> ssl_adapter_; |
126 | 126 |
127 std::string data_; | 127 std::string data_; |
128 }; | 128 }; |
129 | 129 |
130 class SSLAdapterTestDummyServer : public sigslot::has_slots<> { | 130 class SSLAdapterTestDummyServer : public sigslot::has_slots<> { |
131 public: | 131 public: |
132 explicit SSLAdapterTestDummyServer(const rtc::SSLMode& ssl_mode) | 132 explicit SSLAdapterTestDummyServer(const rtc::SSLMode& ssl_mode) |
133 : ssl_mode_(ssl_mode) { | 133 : ssl_mode_(ssl_mode) { |
134 // Generate a key pair and a certificate for this host. | 134 // Generate a key pair and a certificate for this host. |
135 ssl_identity_.reset(rtc::SSLIdentity::Generate(GetHostname())); | 135 ssl_identity_.reset(rtc::SSLIdentity::Generate(GetHostname(), rtc::KT_RSA)); |
136 | 136 |
137 server_socket_.reset(CreateSocket(ssl_mode_)); | 137 server_socket_.reset(CreateSocket(ssl_mode_)); |
138 | 138 |
139 if (ssl_mode_ == rtc::SSL_MODE_TLS) { | 139 if (ssl_mode_ == rtc::SSL_MODE_TLS) { |
140 server_socket_->SignalReadEvent.connect(this, | 140 server_socket_->SignalReadEvent.connect(this, |
141 &SSLAdapterTestDummyServer::OnServerSocketReadEvent); | 141 &SSLAdapterTestDummyServer::OnServerSocketReadEvent); |
142 | 142 |
143 server_socket_->Listen(1); | 143 server_socket_->Listen(1); |
144 } | 144 } |
145 | 145 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 TestHandshake(true); | 375 TestHandshake(true); |
376 } | 376 } |
377 | 377 |
378 // Test transfer between client and server | 378 // Test transfer between client and server |
379 TEST_F(SSLAdapterTestDTLS, TestDTLSTransfer) { | 379 TEST_F(SSLAdapterTestDTLS, TestDTLSTransfer) { |
380 TestHandshake(true); | 380 TestHandshake(true); |
381 TestTransfer("Hello, world!"); | 381 TestTransfer("Hello, world!"); |
382 } | 382 } |
383 | 383 |
384 #endif // SSL_USE_OPENSSL | 384 #endif // SSL_USE_OPENSSL |
385 | |
OLD | NEW |