MongoDB C++ Driver mongocxx-4.0.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
25
26namespace mongocxx {
27namespace v_noabi {
28namespace options {
29
33class tls {
34 public:
47
55 pem_file() const;
56
68 pem_password(bsoncxx::v_noabi::string::view_or_value pem_password);
69
76 const bsoncxx::v_noabi::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
98 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
99 ca_file() const;
100
111 MONGOCXX_ABI_EXPORT_CDECL(tls&) ca_dir(bsoncxx::v_noabi::string::view_or_value ca_dir);
112
119 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
120 ca_dir() const;
121
132 MONGOCXX_ABI_EXPORT_CDECL(tls&) crl_file(bsoncxx::v_noabi::string::view_or_value crl_file);
133
140 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
141 crl_file() const;
142
154
160 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<bool>&)
162
163 private:
164 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _pem_file;
165 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _pem_password;
166 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _ca_file;
167 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _ca_dir;
168 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _crl_file;
169 bsoncxx::v_noabi::stdx::optional<bool> _allow_invalid_certificates;
170};
171
172} // namespace options
173} // namespace v_noabi
174} // namespace mongocxx
175
176#include <mongocxx/config/postlude.hpp>
177
A polyfill for std::optional<T>.
Definition optional.hpp:826
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:33
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 bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & pem_password() const
Retrieves the current decryption pass phrase.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & pem_file() const
Retrieves the current path to the .pem file.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & ca_dir() const
Retrieves the current path to the CA directory.
const bsoncxx::v_noabi::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 bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & ca_file() const
Retrieves the current path to the CA file.
const bsoncxx::v_noabi::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:204
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.
Provides bsoncxx::v_noabi::string::view_or_value.
Declares mongocxx::v_noabi::options::tls.