Hazelcast C++ Client
ssl_config.h
1 /*
2  * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <string>
19 
20 #include <vector>
21 
22 #include "hazelcast/util/export.h"
23 
24 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
25 #pragma warning(push)
26 #pragma warning(disable: 4251) //for dll export
27 #endif
28 
29 namespace hazelcast {
30  namespace client {
31  namespace config {
32  enum HAZELCAST_API ssl_protocol
33  {
35  sslv2 = 0, // boost::asio::ssl::context_base::sslv2
36 
38  sslv3 = 3, // boost::asio::ssl::context_base::sslv3
39 
41  tlsv1 = 6, // boost::asio::ssl::context_base::tlsv1
42 
44  sslv23 = 9, // boost::asio::ssl::context_base::sslv23
45 
47  tlsv11 = 12, // boost::asio::ssl::context_base::tlsv11,
48 
50  tlsv12 = 15, // boost::asio::ssl::context_base::tlsv12
51  };
52 
56  class HAZELCAST_API ssl_config {
57  public:
61  ssl_config();
62 
68  bool is_enabled() const;
69 
75  ssl_config &set_enabled(bool is_enabled);
76 
82  ssl_config &set_protocol(ssl_protocol protocol);
83 
87  ssl_protocol get_protocol() const;
88 
92  const std::vector<std::string> &get_verify_files() const;
93 
102  ssl_config &add_verify_file(const std::string &filename);
103 
107  const std::string &get_cipher_list() const;
108 
119  ssl_config &set_cipher_list(const std::string &ciphers);
120  private:
121  bool enabled_;
122  ssl_protocol ssl_protocol_;
123  std::vector<std::string> client_verify_files_;
124  std::string cipher_list_;
125  };
126  }
127  }
128 }
129 
130 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
131 #pragma warning(pop)
132 #endif
133 
134 
Definition: address.h:30
Contains configuration parameters for client network related behaviour.
Definition: ssl_config.h:56