MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
tls.hpp
Go to the documentation of this file.
1// Copyright 2009-present 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
20
23
24#include <mongocxx/stdx.hpp>
25
27
28namespace mongocxx {
29namespace v_noabi {
30namespace options {
31
35class tls {
36 public:
49
56 pem_file() const;
57
69 pem_password(bsoncxx::v_noabi::string::view_or_value pem_password);
70
76 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
77 pem_password() const;
78
90 MONGOCXX_ABI_EXPORT_CDECL(tls&) ca_file(bsoncxx::v_noabi::string::view_or_value ca_file);
91
97 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
98 ca_file() const;
99
110 MONGOCXX_ABI_EXPORT_CDECL(tls&) ca_dir(bsoncxx::v_noabi::string::view_or_value ca_dir);
111
117 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
118 ca_dir() const;
119
130 MONGOCXX_ABI_EXPORT_CDECL(tls&) crl_file(bsoncxx::v_noabi::string::view_or_value crl_file);
131
137 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
138 crl_file() const;
139
151
157 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bool>&) allow_invalid_certificates() const;
158
159 private:
160 stdx::optional<bsoncxx::v_noabi::string::view_or_value> _pem_file;
161 stdx::optional<bsoncxx::v_noabi::string::view_or_value> _pem_password;
162 stdx::optional<bsoncxx::v_noabi::string::view_or_value> _ca_file;
163 stdx::optional<bsoncxx::v_noabi::string::view_or_value> _ca_dir;
164 stdx::optional<bsoncxx::v_noabi::string::view_or_value> _crl_file;
165 stdx::optional<bool> _allow_invalid_certificates;
166};
167
168} // namespace options
169} // namespace v_noabi
170} // namespace mongocxx
171
172#include <mongocxx/config/postlude.hpp>
173
A polyfill for std::optional<T>.
Definition optional.hpp:874
Class representing a view-or-value variant type for strings.
Definition view_or_value.hpp:41
Class representing the optional arguments to a MongoDB driver client (TLS)
Definition tls.hpp:35
tls & pem_file(bsoncxx::v_noabi::string::view_or_value pem_file)
The path to the .pem file containing a public key certificate and its associated private key.
const stdx::optional< bsoncxx::v_noabi::string::view_or_value > & pem_password() const
Retrieves the current decryption pass phrase.
const stdx::optional< bsoncxx::v_noabi::string::view_or_value > & ca_dir() const
Retrieves the current path to the CA directory.
const stdx::optional< bsoncxx::v_noabi::string::view_or_value > & pem_file() const
Retrieves the current path to the .pem file.
const stdx::optional< bsoncxx::v_noabi::string::view_or_value > & ca_file() const
Retrieves the current path to the CA file.
const stdx::optional< bsoncxx::v_noabi::string::view_or_value > & crl_file() const
Retrieves the current path to the .pem file that contains revoked certificates.
const stdx::optional< bool > & allow_invalid_certificates() const
Retrieves whether or not the driver will check the server's CA file.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
The mongocxx macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
The top-level namespace within which all mongocxx library entities are declared.
Provides std::optional-related polyfills for library API usage.
Redeclares bsoncxx::v_noabi::stdx in mongocxx::v_noabi::stdx for internal use.
Provides bsoncxx::v_noabi::string::view_or_value.
Declares mongocxx::v_noabi::options::tls.