SSL_CTX_use_serverinfo.pod 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. =pod
  2. =head1 NAME
  3. SSL_CTX_use_serverinfo_ex,
  4. SSL_CTX_use_serverinfo,
  5. SSL_CTX_use_serverinfo_file
  6. - use serverinfo extension
  7. =head1 SYNOPSIS
  8. #include <openssl/ssl.h>
  9. int SSL_CTX_use_serverinfo_ex(SSL_CTX *ctx, unsigned int version,
  10. const unsigned char *serverinfo,
  11. size_t serverinfo_length);
  12. int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
  13. size_t serverinfo_length);
  14. int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);
  15. =head1 DESCRIPTION
  16. These functions load "serverinfo" TLS extensions into the SSL_CTX. A
  17. "serverinfo" extension is returned in response to an empty ClientHello
  18. Extension.
  19. SSL_CTX_use_serverinfo_ex() loads one or more serverinfo extensions from
  20. a byte array into B<ctx>. The B<version> parameter specifies the format of the
  21. byte array provided in B<*serverinfo> which is of length B<serverinfo_length>.
  22. If B<version> is B<SSL_SERVERINFOV2> then the extensions in the array must
  23. consist of a 4-byte context, a 2-byte Extension Type, a 2-byte length, and then
  24. length bytes of extension_data. The context and type values have the same
  25. meaning as for L<SSL_CTX_add_custom_ext(3)>. If serverinfo is being loaded for
  26. extensions to be added to a Certificate message, then the extension will only
  27. be added for the first certificate in the message (which is always the
  28. end-entity certificate).
  29. If B<version> is B<SSL_SERVERINFOV1> then the extensions in the array must
  30. consist of a 2-byte Extension Type, a 2-byte length, and then length bytes of
  31. extension_data. The type value has the same meaning as for
  32. L<SSL_CTX_add_custom_ext(3)>. The following default context value will be used
  33. in this case:
  34. SSL_EXT_TLS1_2_AND_BELOW_ONLY | SSL_EXT_CLIENT_HELLO
  35. | SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_IGNORE_ON_RESUMPTION
  36. SSL_CTX_use_serverinfo() does the same thing as SSL_CTX_use_serverinfo_ex()
  37. except that there is no B<version> parameter so a default version of
  38. SSL_SERVERINFOV1 is used instead.
  39. SSL_CTX_use_serverinfo_file() loads one or more serverinfo extensions from
  40. B<file> into B<ctx>. The extensions must be in PEM format. Each extension
  41. must be in a format as described above for SSL_CTX_use_serverinfo_ex(). Each
  42. PEM extension name must begin with the phrase "BEGIN SERVERINFOV2 FOR " for
  43. SSL_SERVERINFOV2 data or "BEGIN SERVERINFO FOR " for SSL_SERVERINFOV1 data.
  44. If more than one certificate (RSA/DSA) is installed using
  45. SSL_CTX_use_certificate(), the serverinfo extension will be loaded into the
  46. last certificate installed. If e.g. the last item was a RSA certificate, the
  47. loaded serverinfo extension data will be loaded for that certificate. To
  48. use the serverinfo extension for multiple certificates,
  49. SSL_CTX_use_serverinfo() needs to be called multiple times, once B<after>
  50. each time a certificate is loaded via a call to SSL_CTX_use_certificate().
  51. =head1 RETURN VALUES
  52. On success, the functions return 1.
  53. On failure, the functions return 0. Check out the error stack to find out
  54. the reason.
  55. =head1 COPYRIGHT
  56. Copyright 2013-2017 The OpenSSL Project Authors. All Rights Reserved.
  57. Licensed under the OpenSSL license (the "License"). You may not use
  58. this file except in compliance with the License. You can obtain a copy
  59. in the file LICENSE in the source distribution or at
  60. L<https://www.openssl.org/source/license.html>.
  61. =cut