MongoDB C++ Driver  mongocxx-3.0.2
ssl.hpp
1 // Copyright 2014 MongoDB Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include <string>
18 
19 #include <bsoncxx/stdx/optional.hpp>
20 #include <bsoncxx/string/view_or_value.hpp>
21 #include <mongocxx/stdx.hpp>
22 
23 #include <mongocxx/config/prelude.hpp>
24 
25 namespace mongocxx {
26 MONGOCXX_INLINE_NAMESPACE_BEGIN
27 namespace options {
28 
32 class MONGOCXX_API ssl {
33  public:
41  ssl& pem_file(bsoncxx::string::view_or_value pem_file);
42 
48  const stdx::optional<bsoncxx::string::view_or_value>& pem_file() const;
49 
56  ssl& pem_password(bsoncxx::string::view_or_value pem_password);
57 
63  const stdx::optional<bsoncxx::string::view_or_value>& pem_password() const;
64 
72  ssl& ca_file(bsoncxx::string::view_or_value ca_file);
73 
79  const stdx::optional<bsoncxx::string::view_or_value>& ca_file() const;
80 
87  ssl& ca_dir(bsoncxx::string::view_or_value ca_dir);
88 
94  const stdx::optional<bsoncxx::string::view_or_value>& ca_dir() const;
95 
102  ssl& crl_file(bsoncxx::string::view_or_value crl_file);
103 
109  const stdx::optional<bsoncxx::string::view_or_value>& crl_file() const;
110 
117  ssl& allow_invalid_certificates(bool allow_invalid_certificates);
118 
124  const stdx::optional<bool>& allow_invalid_certificates() const;
125 
126  private:
127  stdx::optional<bsoncxx::string::view_or_value> _pem_file;
128  stdx::optional<bsoncxx::string::view_or_value> _pem_password;
129  stdx::optional<bsoncxx::string::view_or_value> _ca_file;
130  stdx::optional<bsoncxx::string::view_or_value> _ca_dir;
131  stdx::optional<bsoncxx::string::view_or_value> _crl_file;
132  stdx::optional<bool> _allow_invalid_certificates;
133 };
134 
135 } // namespace options
136 MONGOCXX_INLINE_NAMESPACE_END
137 } // namespace mongocxx
138 
139 #include <mongocxx/config/postlude.hpp>
Definition: bulk_write.hpp:22
Class representing the optional arguments to a MongoDB driver client (SSL)
Definition: ssl.hpp:32
Class representing a view-or-value variant type for strings.
Definition: view_or_value.hpp:36