MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
54 pem_file() const;
55
67 pem_password(bsoncxx::v_noabi::string::view_or_value pem_password);
68
74 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> const&)
75 pem_password() const;
76
89
95 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> const&)
96 ca_file() const;
97
109
115 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> const&)
116 ca_dir() const;
117
129
135 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> const&)
136 crl_file() const;
137
149
155 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bool> const&)
157
158 private:
159 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _pem_file;
160 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _pem_password;
161 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _ca_file;
162 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _ca_dir;
163 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _crl_file;
164 bsoncxx::v_noabi::stdx::optional<bool> _allow_invalid_certificates;
165};
166
167} // namespace options
168} // namespace v_noabi
169} // namespace mongocxx
170
171#include <mongocxx/config/postlude.hpp>
172
A polyfill for std::optional<T>.
Definition optional.hpp:800
A view-or-value variant type for strings.
Definition view_or_value.hpp:41
Used by mongocxx::v_noabi::options::client::tls_opts.
Definition tls.hpp:33
tls & ca_dir(bsoncxx::v_noabi::string::view_or_value ca_dir)
The path to the Certificate Authority directory.
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.
tls & allow_invalid_certificates(bool allow_invalid_certificates)
If true, the driver will not verify the server's CA file.
tls & crl_file(bsoncxx::v_noabi::string::view_or_value crl_file)
The path to the .pem file that contains revoked certificates.
tls & ca_file(bsoncxx::v_noabi::string::view_or_value ca_file)
The path to the .pem file that contains the root certificate chain from the Certificate Authority.
tls & pem_password(bsoncxx::v_noabi::string::view_or_value pem_password)
The pass phrase used to decrypt an encrypted PEM file.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Provides bsoncxx::v_noabi::string::view_or_value.
Declares mongocxx::v_noabi::options::tls.
Provides std::optional-related polyfills for library API usage.