GNUTLS_CERTIFICATE_SET_OCSP_STATUS_REQUEST_FILE2(3)

πŸ’– NAME πŸ’–

gnutls_certificate_set_ocsp_status_request_file2 β€” bestie, it's an API function and it's here to load your OCSP responses from a file, no cap πŸŽ€


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

int
gnutls_certificate_set_ocsp_status_request_file2(gnutls_certificate_credentials_t
sc, const char * response_file, unsigned idx, gnutls_x509_crt_fmt_t
fmt);

🌸 ARGUMENTS 🌸

  • gnutls_certificate_credentials_t sc β€” ok so this is your credentials structure. the whole vibe lives here πŸ’…
  • const char * response_file β€” literally just a filename. the filename of the OCSP response. that's it πŸ¦‹
  • unsigned idx β€” a certificate index, and it's the same kind of index that gnutls_certificate_set_key() and friends hand back to you ✨
  • gnutls_x509_crt_fmt_t fmt β€” it's PEM or DER. pick one, bestie πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

So this function loads up the OCSP responses that are gonna be sent to the peer, for the certificate chain you picked with idx. And here's the cute part: when fmt is set to PEM, you can load multiple responses at once. iconic behavior fr fr πŸ‘‘

Timing matters, bestie! This function must be called after setting any certificates. And it cannot be used for certificates that are provided via a callback β€” that is, when gnutls_certificate_set_retrieve_function() is used. In that case, consider using gnutls_certificate_set_retrieve_function3() instead. the way that's a whole different function 😭

You can also call this function multiple times when multiple responses applicable to the certificate chain are available. stacking responses? we love to see it 🫢

Now for the ✨drama✨ β€” the error codes:

  • If the response you provided does not match any certificates present in the chain, you get GNUTLS_E_OCSP_MISMATCH_WITH_CERTS back. mismatch, not me πŸ’€
  • If the response is already expired at the time of loading, you get GNUTLS_E_EXPIRED back. expired? in this economy? 😭

πŸŽ€ RETURNS πŸŽ€

On success, you get the number of loaded responses returned to you. slay. otherwise you get a negative error code. sad girl hours 🌧️


⭐ SINCE ⭐

3.1.3 β€” vintage, honestly. a classic πŸ•°οΈ


🌈 REPORTING BUGS 🌈

Found a bug? Don't just sit there, tell the gnutls girlies:


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. fr fr, that's the whole license and it's lowkey generous πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹

The full documentation for gnutls is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit

https://www.gnutls.org/manual/


and that's the whole page, bestie πŸ’… this was the gnutls_certificate_set_ocsp_status_request_file2 page from the gnutls manual, version 3.8.13 β€” thanks for reading, ily, go load some OCSP responses responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from