summaryrefslogtreecommitdiff
path: root/src/components/security_manager/test/ssl_certificate_handshake_test.cc
blob: 1034bb3c837dc8d0f9844b1ecf8968b0978fee93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
/*
 * Copyright (c) 2015, Ford Motor Company
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following
 * disclaimer in the documentation and/or other materials provided with the
 * distribution.
 *
 * Neither the name of the Ford Motor Company nor the names of its contributors
 * may be used to endorse or promote products derived from this software
 * without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <fstream>
#include <sstream>

#include "gtest/gtest.h"
#include "security_manager/crypto_manager_impl.h"
#include "security_manager/mock_security_manager_settings.h"
#include "utils/custom_string.h"

using ::testing::Return;
using ::testing::ReturnRef;

namespace test {
namespace components {
namespace ssl_handshake_test {
namespace custom_str = utils::custom_string;
// Use this macro for correct line printing
// in case of fail insize of the #method
#define GTEST_TRACE(method) \
  do {                      \
    SCOPED_TRACE("");       \
    method;                 \
  } while (false)

namespace {
const std::string server_ca_cert_filename = "server";
const std::string client_ca_cert_filename = "client";
const std::string client_cert_filename = "client.crt";
const std::string server_cert_filename = "server.crt";
const std::string client_key_filename = "client_private.key";
const std::string server_key_filename = "server_private.key";
const std::string client_certificate = "client/client_credential.pem";
const std::string server_certificate = "server/spt_credential.pem";
const std::string server_unsigned_cert_file =
    "server/spt_credential_unsigned.pem";
const std::string server_expired_cert_file =
    "server/spt_credential_expired.pem";

const bool verify_peer = true;
const bool skip_peer_verification = false;

}  // namespace
struct Protocol {
  security_manager::Protocol server_protocol;
  security_manager::Protocol client_protocol;

  Protocol(security_manager::Protocol s_protocol,
           security_manager::Protocol c_protocol)
      : server_protocol(s_protocol), client_protocol(c_protocol) {}
};

class SSLHandshakeTest : public testing::TestWithParam<Protocol> {
 protected:
  void SetUp() OVERRIDE {
    mock_server_manager_settings_ = new testing::NiceMock<
        security_manager_test::MockCryptoManagerSettings>();

    server_manager_ = new security_manager::CryptoManagerImpl(
        std::shared_ptr<security_manager::CryptoManagerSettings>(
            mock_server_manager_settings_));
    ASSERT_TRUE(server_manager_);
    mock_client_manager_settings_ = new testing::NiceMock<
        security_manager_test::MockCryptoManagerSettings>();

    client_manager_ = new security_manager::CryptoManagerImpl(
        std::shared_ptr<security_manager::CryptoManagerSettings>(
            mock_client_manager_settings_));
    ASSERT_TRUE(client_manager_);
    server_ctx_ = NULL;
    client_ctx_ = NULL;
  }

  void TearDown() OVERRIDE {
    server_manager_->ReleaseSSLContext(server_ctx_);
    delete server_manager_;
    client_manager_->ReleaseSSLContext(client_ctx_);
    delete client_manager_;
  }

  void SetServerInitialValues(const security_manager::Protocol protocol,
                              const std::string cert,
                              const std::string server_ciphers_list,
                              const bool verify_peer,
                              const std::string& ca_certificate_path) {
    server_certificate_ = cert;
    server_ciphers_list_ = server_ciphers_list;
    server_ca_certificate_path_ = ca_certificate_path;
    ON_CALL(*mock_server_manager_settings_, force_unprotected_service())
        .WillByDefault(ReturnRef(forced_unprotected_service_));
    ON_CALL(*mock_server_manager_settings_, force_protected_service())
        .WillByDefault(ReturnRef(forced_protected_service_));
    ON_CALL(*mock_server_manager_settings_, security_manager_mode())
        .WillByDefault(Return(security_manager::SERVER));
    ON_CALL(*mock_server_manager_settings_, security_manager_protocol_name())
        .WillByDefault(Return(protocol));
    ON_CALL(*mock_server_manager_settings_, certificate_data())
        .WillByDefault(ReturnRef(server_certificate_));
    ON_CALL(*mock_server_manager_settings_, ciphers_list())
        .WillByDefault(ReturnRef(server_ciphers_list_));
    ON_CALL(*mock_server_manager_settings_, ca_cert_path())
        .WillByDefault(ReturnRef(server_ca_certificate_path_));
    ON_CALL(*mock_server_manager_settings_, module_cert_path())
        .WillByDefault(ReturnRef(server_cert_filename));
    ON_CALL(*mock_server_manager_settings_, module_key_path())
        .WillByDefault(ReturnRef(server_key_filename));
    ON_CALL(*mock_server_manager_settings_, verify_peer())
        .WillByDefault(Return(verify_peer));
  }
  void SetClientInitialValues(const security_manager::Protocol protocol,
                              const std::string certificate,
                              const std::string client_ciphers_list,
                              const bool verify_peer,
                              const std::string& ca_certificate_path) {
    client_certificate_ = certificate;
    client_ciphers_list_ = client_ciphers_list;
    client_ca_certificate_path_ = ca_certificate_path;

    ON_CALL(*mock_client_manager_settings_, force_unprotected_service())
        .WillByDefault(ReturnRef(forced_unprotected_service_));
    ON_CALL(*mock_client_manager_settings_, force_protected_service())
        .WillByDefault(ReturnRef(forced_protected_service_));
    ON_CALL(*mock_client_manager_settings_, security_manager_mode())
        .WillByDefault(Return(security_manager::CLIENT));
    ON_CALL(*mock_client_manager_settings_, security_manager_protocol_name())
        .WillByDefault(Return(protocol));
    ON_CALL(*mock_client_manager_settings_, certificate_data())
        .WillByDefault(ReturnRef(client_certificate_));
    ON_CALL(*mock_client_manager_settings_, ciphers_list())
        .WillByDefault(ReturnRef(client_ciphers_list_));
    ON_CALL(*mock_client_manager_settings_, ca_cert_path())
        .WillByDefault(ReturnRef(client_ca_certificate_path_));
    ON_CALL(*mock_client_manager_settings_, module_cert_path())
        .WillByDefault(ReturnRef(client_cert_filename));
    ON_CALL(*mock_client_manager_settings_, module_key_path())
        .WillByDefault(ReturnRef(client_key_filename));
    ON_CALL(*mock_client_manager_settings_, verify_peer())
        .WillByDefault(Return(verify_peer));
  }

  bool InitServerManagers(security_manager::Protocol protocol,
                          const std::string& cert_filename,
                          const std::string& ciphers_list,
                          const bool verify_peer,
                          const std::string& ca_certificate_path) {
    std::ifstream cert(cert_filename);
    std::stringstream ss;
    if (cert.is_open()) {
      ss << cert.rdbuf();
    }
    cert.close();
    SetServerInitialValues(
        protocol, ss.str(), ciphers_list, verify_peer, ca_certificate_path);
    const bool initialized = server_manager_->Init();

    if (!initialized) {
      return false;
    }

    server_ctx_ = server_manager_->CreateSSLContext();

    if (!server_ctx_) {
      return false;
    }

    server_ctx_->SetHandshakeContext(
        security_manager::SSLContext::HandshakeContext(
            custom_str::CustomString("SPT"),
            custom_str::CustomString("client")));

    return true;
  }

  bool InitClientManagers(security_manager::Protocol protocol,
                          const std::string& cert_filename,
                          const std::string& ciphers_list,
                          const bool verify_peer,
                          const std::string& ca_certificate_path) {
    std::ifstream cert(cert_filename);
    std::stringstream certificate;
    if (cert.is_open()) {
      certificate << cert.rdbuf();
    }
    cert.close();
    SetClientInitialValues(protocol,
                           certificate.str(),
                           ciphers_list,
                           verify_peer,
                           ca_certificate_path);
    const bool initialized = client_manager_->Init();
    if (!initialized) {
      return false;
    }

    client_ctx_ = client_manager_->CreateSSLContext();
    if (!client_ctx_) {
      return false;
    }

    client_ctx_->SetHandshakeContext(
        security_manager::SSLContext::HandshakeContext(
            custom_str::CustomString("SPT"),
            custom_str::CustomString("server")));

    return true;
  }

  void ResetConnections() {
    ASSERT_NO_THROW(server_ctx_->ResetConnection());
    ASSERT_NO_THROW(client_ctx_->ResetConnection());
  }

  void StartHandshake() {
    using security_manager::SSLContext;

    ASSERT_EQ(SSLContext::Handshake_Result_Success,
              client_ctx_->StartHandshake(&client_buf_, &client_buf_len_));
    ASSERT_FALSE(client_buf_ == NULL);
    ASSERT_GT(client_buf_len_, 0u);
  }

  void HandshakeProcedure_Success() {
    using security_manager::SSLContext;
    StartHandshake();

    while (true) {
      ASSERT_EQ(
          SSLContext::Handshake_Result_Success,
          server_ctx_->DoHandshakeStep(
              client_buf_, client_buf_len_, &server_buf_, &server_buf_len_))
          << ERR_reason_error_string(ERR_get_error());
      ASSERT_FALSE(server_buf_ == NULL);
      ASSERT_GT(server_buf_len_, 0u);

      ASSERT_EQ(
          SSLContext::Handshake_Result_Success,
          client_ctx_->DoHandshakeStep(
              server_buf_, server_buf_len_, &client_buf_, &client_buf_len_))
          << ERR_reason_error_string(ERR_get_error());
      if (server_ctx_->IsInitCompleted()) {
        break;
      }

      ASSERT_FALSE(client_buf_ == NULL);
      ASSERT_GT(client_buf_len_, 0u);
    }
  }

  void HandshakeProcedure_ServerSideFail() {
    using security_manager::SSLContext;

    StartHandshake();

    while (true) {
      const SSLContext::HandshakeResult result = server_ctx_->DoHandshakeStep(
          client_buf_, client_buf_len_, &server_buf_, &server_buf_len_);
      ASSERT_FALSE(server_ctx_->IsInitCompleted())
          << "Expected server side handshake fail";

      // First few handshake will be successful
      if (result != SSLContext::Handshake_Result_Success) {
        // Test successfully passed with handshake fail
        return;
      }
      ASSERT_FALSE(server_buf_ == NULL);
      ASSERT_GT(server_buf_len_, 0u);

      ASSERT_EQ(
          SSLContext::Handshake_Result_Success,
          client_ctx_->DoHandshakeStep(
              server_buf_, server_buf_len_, &client_buf_, &client_buf_len_))
          << ERR_reason_error_string(ERR_get_error());
      ASSERT_FALSE(client_ctx_->IsInitCompleted())
          << "Expected server side handshake fail";

      ASSERT_FALSE(client_buf_ == NULL);
      ASSERT_GT(client_buf_len_, 0u);
    }
    FAIL() << "Expected server side handshake fail";
  }

  void HandshakeProcedure_ClientSideFail(
      security_manager::SSLContext::HandshakeResult expected_result) {
    using security_manager::SSLContext;

    StartHandshake();

    while (true) {
      ASSERT_EQ(
          SSLContext::Handshake_Result_Success,
          server_ctx_->DoHandshakeStep(
              client_buf_, client_buf_len_, &server_buf_, &server_buf_len_))
          << ERR_reason_error_string(ERR_get_error());

      ASSERT_FALSE(server_buf_ == NULL);
      ASSERT_GT(server_buf_len_, 0u);

      const SSLContext::HandshakeResult result = client_ctx_->DoHandshakeStep(
          server_buf_, server_buf_len_, &client_buf_, &client_buf_len_);
      ASSERT_FALSE(client_ctx_->IsInitCompleted())
          << "Expected client side handshake fail";

      // First few handsahke will be successful
      if (result != SSLContext::Handshake_Result_Success) {
        // Test successfully passed with handshake fail
        ASSERT_EQ(expected_result, result);
        return;
      }

      ASSERT_FALSE(client_buf_ == NULL);
      ASSERT_GT(client_buf_len_, 0u);
    }
    FAIL() << "Expected client side handshake fail";
  }

  security_manager::CryptoManager* server_manager_;
  security_manager::CryptoManager* client_manager_;
  security_manager::SSLContext* server_ctx_;
  security_manager::SSLContext* client_ctx_;
  testing::NiceMock<security_manager_test::MockCryptoManagerSettings>*
      mock_server_manager_settings_;
  testing::NiceMock<security_manager_test::MockCryptoManagerSettings>*
      mock_client_manager_settings_;

  const uint8_t* server_buf_;
  const uint8_t* client_buf_;
  size_t server_buf_len_;
  size_t client_buf_len_;

  std::string server_certificate_;
  std::string server_ciphers_list_;
  std::string server_ca_certificate_path_;

  std::string client_certificate_;
  std::string client_ciphers_list_;
  std::string client_ca_certificate_path_;

  const std::vector<int> forced_protected_service_;
  const std::vector<int> forced_unprotected_service_;
};

INSTANTIATE_TEST_CASE_P(
    CorrectProtocol,
    SSLHandshakeTest,
    ::testing::Values(
        Protocol(security_manager::TLSv1, security_manager::TLSv1),
        Protocol(security_manager::TLSv1_1, security_manager::TLSv1_1),
        Protocol(security_manager::TLSv1_2, security_manager::TLSv1_2),
        Protocol(security_manager::DTLSv1, security_manager::DTLSv1)));

TEST_P(SSLHandshakeTest, NoVerification) {
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_certificate,
                                 "ALL",
                                 skip_peer_verification,
                                 ""))
      << server_manager_->LastError();

  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 skip_peer_verification,
                                 ""))
      << client_manager_->LastError();

  GTEST_TRACE(HandshakeProcedure_Success());
}

TEST_P(SSLHandshakeTest, CAVerification_ServerSide) {
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_certificate,
                                 "ALL",
                                 verify_peer,
                                 client_ca_cert_filename))
      << server_manager_->LastError();
  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 skip_peer_verification,
                                 ""))
      << client_manager_->LastError();

  GTEST_TRACE(HandshakeProcedure_Success());
}

TEST_P(SSLHandshakeTest, CAVerification_ServerSide_NoCACertificate) {
  ASSERT_TRUE(InitServerManagers(
      GetParam().server_protocol, "", "ALL", verify_peer, "unex"))
      << server_manager_->LastError();
  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 skip_peer_verification,
                                 ""))
      << client_manager_->LastError();

  GTEST_TRACE(HandshakeProcedure_ServerSideFail());
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_certificate,
                                 "ALL",
                                 verify_peer,
                                 client_ca_cert_filename))
      << server_manager_->LastError();

  GTEST_TRACE(ResetConnections());

  GTEST_TRACE(HandshakeProcedure_Success());
}

TEST_P(SSLHandshakeTest, CAVerification_ClientSide_NoCACertificate) {
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_certificate,
                                 "ALL",
                                 skip_peer_verification,
                                 ""))
      << server_manager_->LastError();
  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 "",
                                 "ALL",
                                 verify_peer,
                                 "client_ca_cert_filename"))
      << client_manager_->LastError();

  GTEST_TRACE(HandshakeProcedure_ClientSideFail(
      security_manager::SSLContext::Handshake_Result_Fail));

  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 verify_peer,
                                 server_ca_cert_filename))
      << client_manager_->LastError();

  GTEST_TRACE(ResetConnections());

  GTEST_TRACE(HandshakeProcedure_Success());
}

TEST_P(SSLHandshakeTest, CAVerification_BothSides) {
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_certificate,
                                 "ALL",
                                 verify_peer,
                                 client_ca_cert_filename))
      << server_manager_->LastError();
  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 verify_peer,
                                 server_ca_cert_filename))
      << client_manager_->LastError();

  GTEST_TRACE(HandshakeProcedure_Success());
}

TEST_P(SSLHandshakeTest, UnsignedCert) {
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_unsigned_cert_file,
                                 "ALL",
                                 skip_peer_verification,
                                 ""))
      << server_manager_->LastError();
  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 verify_peer,
                                 client_ca_cert_filename))
      << client_manager_->LastError();
  GTEST_TRACE(HandshakeProcedure_ClientSideFail(
      security_manager::SSLContext::Handshake_Result_CertNotSigned));
}

TEST_P(SSLHandshakeTest, ExpiredCert) {
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_expired_cert_file,
                                 "ALL",
                                 verify_peer,
                                 client_ca_cert_filename))
      << server_manager_->LastError();
  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 verify_peer,
                                 server_ca_cert_filename))
      << client_manager_->LastError();

  GTEST_TRACE(HandshakeProcedure_ClientSideFail(
      security_manager::SSLContext::Handshake_Result_CertExpired));
}

TEST_P(SSLHandshakeTest, AppNameAndAppIDInvalid) {
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_certificate,
                                 "ALL",
                                 verify_peer,
                                 client_ca_cert_filename))
      << server_manager_->LastError();
  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 verify_peer,
                                 server_ca_cert_filename))
      << client_manager_->LastError();

  client_ctx_->SetHandshakeContext(
      security_manager::SSLContext::HandshakeContext(
          custom_str::CustomString("Wrong"),
          custom_str::CustomString("server")));

  GTEST_TRACE(HandshakeProcedure_ClientSideFail(
      security_manager::SSLContext::Handshake_Result_AppIDMismatch));
}

TEST_P(SSLHandshakeTest, NoVerification_ResetConnection) {
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_certificate,
                                 "ALL",
                                 skip_peer_verification,
                                 ""))
      << server_manager_->LastError();
  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 skip_peer_verification,
                                 ""))
      << client_manager_->LastError();

  const int times = 100;
  for (int i = 0; i < times; ++i) {
    // Expect success  handshake
    GTEST_TRACE(HandshakeProcedure_Success());

    // Reset SSl connections
    GTEST_TRACE(ResetConnections());
  }
}

TEST_P(SSLHandshakeTest, CAVerification_BothSides_ResetConnection) {
  ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
                                 server_certificate,
                                 "ALL",
                                 verify_peer,
                                 client_ca_cert_filename))
      << server_manager_->LastError();
  ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
                                 client_certificate,
                                 "ALL",
                                 skip_peer_verification,
                                 server_ca_cert_filename))
      << client_manager_->LastError();

  const int times = 100;
  for (int i = 0; i < times; ++i) {
    // Expect success  handshake
    GTEST_TRACE(HandshakeProcedure_Success());

    // Reset SSl connections
    GTEST_TRACE(ResetConnections());
  }
}
// TODO(EZamakhov): add fail tests -broken or not full ca certificate chain

}  // namespace ssl_handshake_test
}  // namespace components
}  // namespace test