SSL_CTX_set_tlsext_servername_callback.pod 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. =pod
  2. =head1 NAME
  3. SSL_CTX_set_tlsext_servername_callback, SSL_CTX_set_tlsext_servername_arg,
  4. SSL_get_servername_type, SSL_get_servername - handle server name indication
  5. (SNI)
  6. =head1 SYNOPSIS
  7. #include <openssl/ssl.h>
  8. long SSL_CTX_set_tlsext_servername_callback(SSL_CTX *ctx,
  9. int (*cb)(SSL *, int *, void *));
  10. long SSL_CTX_set_tlsext_servername_arg(SSL_CTX *ctx, void *arg);
  11. const char *SSL_get_servername(const SSL *s, const int type);
  12. int SSL_get_servername_type(const SSL *s);
  13. =head1 DESCRIPTION
  14. SSL_CTX_set_tlsext_servername_callback() sets the application callback B<cb>
  15. used by a server to perform any actions or configuration required based on
  16. the servername extension received in the incoming connection. When B<cb>
  17. is NULL, SNI is not used. The B<arg> value is a pointer which is passed to
  18. the application callback.
  19. SSL_CTX_set_tlsext_servername_arg() sets a context-specific argument to be
  20. passed into the callback for this B<SSL_CTX>.
  21. SSL_get_servername() returns a servername extension value of the specified
  22. type if provided in the Client Hello or NULL.
  23. SSL_get_servername_type() returns the servername type or -1 if no servername
  24. is present. Currently the only supported type (defined in RFC3546) is
  25. B<TLSEXT_NAMETYPE_host_name>.
  26. =head1 NOTES
  27. The ALPN and SNI callbacks are both executed during Client Hello processing.
  28. The servername callback is executed first, followed by the ALPN callback.
  29. =head1 RETURN VALUES
  30. SSL_CTX_set_tlsext_servername_callback() and
  31. SSL_CTX_set_tlsext_servername_arg() both always return 1 indicating success.
  32. =head1 SEE ALSO
  33. L<ssl(7)>, L<SSL_CTX_set_alpn_select_cb(3)>,
  34. L<SSL_get0_alpn_selected(3)>
  35. =head1 COPYRIGHT
  36. Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
  37. Licensed under the OpenSSL license (the "License"). You may not use
  38. this file except in compliance with the License. You can obtain a copy
  39. in the file LICENSE in the source distribution or at
  40. L<https://www.openssl.org/source/license.html>.
  41. =cut