mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Certificates
- Implemented TLSClient::trust, which overrides certifcate validation.
This commit is contained in:
parent
d6d6a098f3
commit
5a0dfa634c
2 changed files with 16 additions and 0 deletions
|
@ -46,6 +46,8 @@
|
||||||
|
|
||||||
#define MAX_BUF 16384
|
#define MAX_BUF 16384
|
||||||
|
|
||||||
|
static bool trust_override = false;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static void gnutls_log_function (int level, const char* message)
|
static void gnutls_log_function (int level, const char* message)
|
||||||
{
|
{
|
||||||
|
@ -93,6 +95,19 @@ void TLSClient::debug (int level)
|
||||||
gnutls_global_set_log_level (level);
|
gnutls_global_set_log_level (level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void TLSClient::trust (bool value)
|
||||||
|
{
|
||||||
|
trust_override = value;
|
||||||
|
if (_debug)
|
||||||
|
{
|
||||||
|
if (trust_override)
|
||||||
|
std::cout << "c: INFO Server certificate trusted automatically.\n";
|
||||||
|
else
|
||||||
|
std::cout << "c: INFO Server certificate trust verified.\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void TLSClient::init (const std::string& ca)
|
void TLSClient::init (const std::string& ca)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
~TLSClient ();
|
~TLSClient ();
|
||||||
void limit (int);
|
void limit (int);
|
||||||
void debug (int);
|
void debug (int);
|
||||||
|
void trust (bool);
|
||||||
void init (const std::string&);
|
void init (const std::string&);
|
||||||
void connect (const std::string&, const std::string&);
|
void connect (const std::string&, const std::string&);
|
||||||
void bye ();
|
void bye ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue