From 33c91102a58e2fbcf9d7a66e33b41a65fa3f0e0c Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Tue, 16 Jun 2020 00:41:57 +0200 Subject: Adds improved client certificate management, adds server certificate management. --- src/ssltrust.hpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/ssltrust.hpp (limited to 'src/ssltrust.hpp') diff --git a/src/ssltrust.hpp b/src/ssltrust.hpp new file mode 100644 index 0000000..62d4985 --- /dev/null +++ b/src/ssltrust.hpp @@ -0,0 +1,37 @@ +#ifndef SSLTRUST_HPP +#define SSLTRUST_HPP + +#include +#include +#include + +#include "trustedhostcollection.hpp" + +struct SslTrust +{ + enum TrustLevel { + TrustOnFirstUse = 0, // default + TrustEverything = 1, // not recommended + TrustNoOne = 2, // approve every fingerprint by hand + }; + + SslTrust() = default; + SslTrust(SslTrust const &) = default; + SslTrust(SslTrust &&) = default; + + SslTrust & operator=(SslTrust const &) = default; + SslTrust & operator=(SslTrust &&) = default; + + TrustLevel trust_level = TrustOnFirstUse; + + TrustedHostCollection trusted_hosts; + + bool enable_ca = false; + + void load(QSettings & settings); + void save(QSettings & settings) const; + + bool isTrusted(QUrl const & url, QSslCertificate const & certificate); +}; + +#endif // SSLTRUST_HPP -- cgit v1.2.3