TLSClient: Improved C++ core guidelines

This commit is contained in:
Paul Beckingham 2016-11-19 13:12:07 -05:00
parent 3be7803d30
commit 992b41b82a
2 changed files with 13 additions and 28 deletions

View file

@ -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 ()
{ {

View file

@ -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