summaryrefslogtreecommitdiff
path: root/doc/examples/ex-serv-x509.c
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/ex-serv-x509.c')
-rw-r--r--doc/examples/ex-serv-x509.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/examples/ex-serv-x509.c b/doc/examples/ex-serv-x509.c
index e67c9592b5..4bf1940b89 100644
--- a/doc/examples/ex-serv-x509.c
+++ b/doc/examples/ex-serv-x509.c
@@ -63,11 +63,16 @@ int main(void)
CHECK(gnutls_certificate_set_x509_crl_file(x509_cred, CRLFILE,
GNUTLS_X509_FMT_PEM));
+ /* The following code sets the certificate key pair as well as,
+ * an OCSP response which corresponds to it. It is possible
+ * to set multiple key-pairs and multiple OCSP status responses
+ * (the latter since 3.5.6). See the manual pages of the individual
+ * functions for more information.
+ */
CHECK(gnutls_certificate_set_x509_key_file(x509_cred, CERTFILE,
KEYFILE,
GNUTLS_X509_FMT_PEM));
- /* loads an OCSP status request if available */
CHECK(gnutls_certificate_set_ocsp_status_request_file(x509_cred,
OCSP_STATUS_FILE,
0));
@@ -75,9 +80,11 @@ int main(void)
CHECK(gnutls_priority_init(&priority_cache,
"PERFORMANCE:%SERVER_PRECEDENCE", NULL));
+#if GNUTLS_VERSION_NUMBER >= 0x030506
/* only available since GnuTLS 3.5.6, on previous versions see
* gnutls_certificate_set_dh_params(). */
gnutls_certificate_set_known_dh_params(x509_cred, GNUTLS_SEC_PARAM_MEDIUM);
+#endif
/* Socket operations
*/