aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/net/tls/transport_security_options_reading.h
blob: 743aba0078ffa1ef09b9a61bc862252f516fc3e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "transport_security_options.h"
#include <memory>

namespace vespalib::net::tls {

// TODO consider renaming TransportSecurityOptions -> TlsConfig

/**
 * Throws IoException if file_path or any files referenced by it can't be accessed
 * Throws IllegalArgumentException if file is not parseable as a valid TLS config file or
 *     if mandatory JSON fields are missing or incomplete.
 */
std::unique_ptr<TransportSecurityOptions> read_options_from_json_file(const vespalib::string& file_path);
// Same properties as read_options_from_json_file()
std::unique_ptr<TransportSecurityOptions> read_options_from_json_string(const vespalib::string& json_data);

}