mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TLSClient: Typo
This commit is contained in:
parent
c5024ddea4
commit
1f0df70ac3
1 changed files with 9 additions and 1 deletions
|
@ -210,8 +210,16 @@ void TLSClient::connect (const std::string& host, const std::string& port)
|
||||||
gnutls_session_set_verify_cert (_session, _host.c_str (), 0); // 3.4.6
|
gnutls_session_set_verify_cert (_session, _host.c_str (), 0); // 3.4.6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// SNI. Only permitted when _host is a DNS name, not an IPv4/6 address.
|
||||||
|
if (_host.find_first_not_of ("0123456789abcdefABCDEF:.") != std::string::npos)
|
||||||
|
{
|
||||||
|
ret = gnutls_server_name_set (_session, GNUTLS_NAME_DNS, _host.c_str (), _host.length ()); // All
|
||||||
|
if (ret < 0)
|
||||||
|
throw format ("TLS SNI error. {1}", gnutls_strerror (ret)); // All
|
||||||
|
}
|
||||||
|
|
||||||
// Store the TLSClient instance, so that the verification callback can access
|
// Store the TLSClient instance, so that the verification callback can access
|
||||||
// it during the handshake below and call the verifcation method.
|
// it during the handshake below and call the verification method.
|
||||||
gnutls_session_set_ptr (_session, (void*) this); // All
|
gnutls_session_set_ptr (_session, (void*) this); // All
|
||||||
|
|
||||||
// use IPv4 or IPv6, does not matter.
|
// use IPv4 or IPv6, does not matter.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue