mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 15:47:19 +02:00
TW-1855: "Well-known" CA certificates not properly auto-loaded
- Thanks to Flavio Poletti.
This commit is contained in:
parent
2d43cbd2c0
commit
a7465d58d7
3 changed files with 10 additions and 0 deletions
|
@ -150,6 +150,13 @@ void TLSClient::init (
|
|||
if (ret < 0)
|
||||
throw format ("TLS allocation error. {1}", gnutls_strerror (ret)); // All
|
||||
|
||||
#if GNUTLS_VERSION_NUMBER >= 0x030014
|
||||
// Automatic loading of system installed CA certificates.
|
||||
ret = gnutls_certificate_set_x509_system_trust (_credentials); // 3.0.20
|
||||
if (ret < 0)
|
||||
throw format ("Bad System Trust. {1}", gnutls_strerror (ret)); // All
|
||||
#endif
|
||||
|
||||
if (_ca != "" &&
|
||||
(ret = gnutls_certificate_set_x509_trust_file (_credentials, _ca.c_str (), GNUTLS_X509_FMT_PEM)) < 0) // All
|
||||
throw format ("Bad CA file. {1}", gnutls_strerror (ret)); // All
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue