summaryrefslogtreecommitdiff
path: root/doc/examples/ex-client-dtls.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-05-16 19:41:46 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-05-22 09:20:36 +0200
commit35b2c4cc8ffd5af9fed7fdb571ecadf0ffea788b (patch)
tree770db6841e0be0ed9589ea73fb049cda7a65fe2d /doc/examples/ex-client-dtls.c
parent16206a5b3030dd85410f587730d08ac01853b37e (diff)
downloadgnutls-35b2c4cc8ffd5af9fed7fdb571ecadf0ffea788b.tar.gz
Be more conservative with examples and changed semantics of gnutls_certificate_set_x509_system_trust(). gnutls_certificate_set_x509_system_trust() returns GNUTLS_E_UNIMPLEMENTED_FEATURE on systems that do not have a (known) default trust store.
Diffstat (limited to 'doc/examples/ex-client-dtls.c')
-rw-r--r--doc/examples/ex-client-dtls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/examples/ex-client-dtls.c b/doc/examples/ex-client-dtls.c
index 377c42e20c..21e7244a56 100644
--- a/doc/examples/ex-client-dtls.c
+++ b/doc/examples/ex-client-dtls.c
@@ -18,6 +18,7 @@
*/
#define MAX_BUF 1024
+#define CAFILE "/etc/ssl/certs/ca-certificates.crt"
#define MSG "GET / HTTP/1.0\r\n\r\n"
extern int udp_connect (void);
@@ -39,7 +40,7 @@ main (void)
gnutls_certificate_allocate_credentials (&xcred);
/* sets the trusted cas file */
- gnutls_certificate_set_x509_system_trust(xcred);
+ gnutls_certificate_set_x509_trust_file (xcred, CAFILE, GNUTLS_X509_FMT_PEM);
gnutls_certificate_set_verify_function (xcred, verify_certificate_callback);
/* Initialize TLS session */