summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2021-09-20 11:41:56 +0300
committerdefanor <defanor@uberspace.net>2021-09-20 11:41:56 +0300
commitb5694f7a20fc85d03016dc028d7e566dd707e50c (patch)
treea33d24b009d456c603b4f24c55422970f25aee59 /examples
parent917211b67cc27f07b3743611ee9389ff966ffba5 (diff)
Restore client certificate (SASL EXTERNAL) authentication
As well as the ability to set a trusted server certificate.
Diffstat (limited to 'examples')
-rw-r--r--examples/basic.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/examples/basic.c b/examples/basic.c
index e122ee8..fa585c9 100644
--- a/examples/basic.c
+++ b/examples/basic.c
@@ -10,7 +10,6 @@
#include <stdio.h>
#include <errno.h>
#include <syslog.h>
-#include <gnutls/gnutls.h>
#include <gsasl.h>
#include <rexmpp.h>
@@ -137,21 +136,16 @@ int main (int argc, char **argv) {
/* Could set a client certificate for SASL EXTERNAL authentication
here. */
- /* gnutls_certificate_set_x509_key_file(s.gnutls_cred, */
- /* "cert.pem", */
- /* "key.pem", */
- /* GNUTLS_X509_FMT_PEM); */
+ /* rexmpp_tls_set_x509_key_file(&s, "client.crt", "client.key"); */
/* Could also set various other things manually. */
/* s.socks_host = "127.0.0.1"; */
/* s.socks_port = 4321; */
- /* s.manual_host = "foo.custom"; */
- /* gnutls_certificate_set_x509_trust_file(s.gnutls_cred, */
- /* "foo.custom.crt", */
- /* GNUTLS_X509_FMT_PEM); */
+ /* s.manual_host = "localhost"; */
+ /* rexmpp_tls_set_x509_trust_file(&s, "localhost.crt"); */
/* rexmpp_openpgp_set_home_dir(&s, "pgp"); */
s.roster_cache_file = "roster.xml";
-
+ /* s.tls_policy = REXMPP_TLS_AVOID; */
/* Once the main structure is initialised and everything is
sufficiently configured, we are ready to run the main loop and