summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2016-10-22 09:41:45 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2016-10-23 20:07:11 +0200
commitf4287236cc686381b0f9f8435cc394ea673b06d1 (patch)
treef16d9351c5d5873a6033d733adebf15d929af99c /doc/examples
parenta8c269964c2bd2a9edf9d6fe7b00481290fa9b13 (diff)
downloadgnutls-tmp-document-api-change.tar.gz
modified the gnutls_certificate_set_key* changetmp-document-api-change
While the change was fully backwards compatible for applications that were adding a single certificate, and applications that were checking for negative errors codes, many applications do not. As this may cause incompatibility issues with software properly utilizing the previously documented API, the change is reverted, and applications need to explicitly enable a flag (GNUTLS_CERTIFICATE_API_V2) in the credentials structure for the set_key functions to return an index.
Diffstat (limited to 'doc/examples')
-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
*/