diff options
Diffstat (limited to 'src/cli/tls_server.cpp')
-rw-r--r-- | src/cli/tls_server.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/cli/tls_server.cpp b/src/cli/tls_server.cpp index 0a133cffd..98cb611d4 100644 --- a/src/cli/tls_server.cpp +++ b/src/cli/tls_server.cpp @@ -26,7 +26,7 @@ #include <list> #include <fstream> -#include "credentials.h" +#include "tls_helpers.h" #include "socket_utils.h" namespace Botan_CLI { @@ -77,23 +77,7 @@ class TLS_Server final : public Command, public Botan::TLS::Callbacks m_is_tcp = (transport == "tcp"); - std::unique_ptr<Botan::TLS::Policy> policy; - const std::string policy_file = get_arg("policy"); - if(policy_file.size() > 0) - { - std::ifstream policy_stream(policy_file); - if(!policy_stream.good()) - { - error_output() << "Failed reading policy file\n"; - return; - } - policy.reset(new Botan::TLS::Text_Policy(policy_stream)); - } - - if(!policy) - { - policy.reset(new Botan::TLS::Policy); - } + auto policy = load_tls_policy(get_arg("policy")); Botan::TLS::Session_Manager_In_Memory session_manager(rng()); // TODO sqlite3 |