mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TLSClient: Improved C++ core guidelines
This commit is contained in:
parent
3be7803d30
commit
992b41b82a
2 changed files with 13 additions and 28 deletions
|
@ -66,21 +66,6 @@ static int verify_certificate_callback (gnutls_session_t session)
|
||||||
return client->verify_certificate ();
|
return client->verify_certificate ();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
TLSClient::TLSClient ()
|
|
||||||
: _ca ("")
|
|
||||||
, _cert ("")
|
|
||||||
, _key ("")
|
|
||||||
, _host ("")
|
|
||||||
, _port ("")
|
|
||||||
, _session(0)
|
|
||||||
, _socket (0)
|
|
||||||
, _limit (0)
|
|
||||||
, _debug (false)
|
|
||||||
, _trust(strict)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
TLSClient::~TLSClient ()
|
TLSClient::~TLSClient ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,7 @@ class TLSClient
|
||||||
public:
|
public:
|
||||||
enum trust_level { strict, ignore_hostname, allow_all };
|
enum trust_level { strict, ignore_hostname, allow_all };
|
||||||
|
|
||||||
TLSClient ();
|
TLSClient () = default;
|
||||||
~TLSClient ();
|
~TLSClient ();
|
||||||
void limit (int);
|
void limit (int);
|
||||||
void debug (int);
|
void debug (int);
|
||||||
|
@ -51,18 +51,18 @@ public:
|
||||||
void recv (std::string&);
|
void recv (std::string&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _ca;
|
std::string _ca {""};
|
||||||
std::string _cert;
|
std::string _cert {""};
|
||||||
std::string _key;
|
std::string _key {""};
|
||||||
std::string _ciphers;
|
std::string _ciphers {""};
|
||||||
std::string _host;
|
std::string _host {""};
|
||||||
std::string _port;
|
std::string _port {""};
|
||||||
gnutls_certificate_credentials_t _credentials;
|
gnutls_certificate_credentials_t _credentials {};
|
||||||
gnutls_session_t _session;
|
gnutls_session_t _session {0};
|
||||||
int _socket;
|
int _socket {0};
|
||||||
int _limit;
|
int _limit {0};
|
||||||
bool _debug;
|
bool _debug {false};
|
||||||
enum trust_level _trust;
|
enum trust_level _trust {strict};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue