gnutls_certificate_set_x509_trust_dir - Linux


gnutls_certificate_set_x509_trust_dir sets the directory containing X.509 trust roots for TLS connections.


gnutls_certificate_set_x509_trust_dir(certificate, dir)


  • dir: The directory path containing the X.509 trust roots.


To set the trust directory to /etc/ssl/certs:

gnutls_certificate_set_x509_trust_dir(certificate, "/etc/ssl/certs")

Common Issues

  • Ensure the directory exists and contains valid X.509 certificates.
  • Check for file permissions to ensure the GNUTLS process has read access to the directory.


Use this command in conjunction with other GNUTLS functions to establish secure TLS connections.

Related Commands

  • gnutls_certificate_set_x509_trust_file: Sets a specific trust file.
  • gnutls_certificate_verify_peers: Verifies peer certificates using the trust store.
  • openssl: Related OpenSSL tool for managing certificates and cryptographic operations.