SSL_set_connect_state.pod 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. =pod
  2. =head1 NAME
  3. SSL_set_connect_state, SSL_set_accept_state, SSL_is_server
  4. - functions for manipulating and examining the client or server mode of an SSL object
  5. =head1 SYNOPSIS
  6. #include <openssl/ssl.h>
  7. void SSL_set_connect_state(SSL *ssl);
  8. void SSL_set_accept_state(SSL *ssl);
  9. int SSL_is_server(const SSL *ssl);
  10. =head1 DESCRIPTION
  11. SSL_set_connect_state() sets B<ssl> to work in client mode.
  12. SSL_set_accept_state() sets B<ssl> to work in server mode.
  13. SSL_is_server() checks if B<ssl> is working in server mode.
  14. =head1 NOTES
  15. When the SSL_CTX object was created with L<SSL_CTX_new(3)>,
  16. it was either assigned a dedicated client method, a dedicated server
  17. method, or a generic method, that can be used for both client and
  18. server connections. (The method might have been changed with
  19. L<SSL_CTX_set_ssl_version(3)> or
  20. L<SSL_set_ssl_method(3)>.)
  21. When beginning a new handshake, the SSL engine must know whether it must
  22. call the connect (client) or accept (server) routines. Even though it may
  23. be clear from the method chosen, whether client or server mode was
  24. requested, the handshake routines must be explicitly set.
  25. When using the L<SSL_connect(3)> or
  26. L<SSL_accept(3)> routines, the correct handshake
  27. routines are automatically set. When performing a transparent negotiation
  28. using L<SSL_write_ex(3)>, L<SSL_write(3)>, L<SSL_read_ex(3)>, or L<SSL_read(3)>,
  29. the handshake routines must be explicitly set in advance using either
  30. SSL_set_connect_state() or SSL_set_accept_state().
  31. If SSL_is_server() is called before SSL_set_connect_state() or
  32. SSL_set_accept_state() is called (either automatically or explicitly),
  33. the result depends on what method was used when SSL_CTX was created with
  34. L<SSL_CTX_new(3)>. If a generic method or a dedicated server method was
  35. passed to L<SSL_CTX_new(3)>, SSL_is_server() returns 1; otherwise, it returns 0.
  36. =head1 RETURN VALUES
  37. SSL_set_connect_state() and SSL_set_accept_state() do not return diagnostic
  38. information.
  39. SSL_is_server() returns 1 if B<ssl> is working in server mode or 0 for client mode.
  40. =head1 SEE ALSO
  41. L<ssl(7)>, L<SSL_new(3)>, L<SSL_CTX_new(3)>,
  42. L<SSL_connect(3)>, L<SSL_accept(3)>,
  43. L<SSL_write_ex(3)>, L<SSL_write(3)>, L<SSL_read_ex(3)>, L<SSL_read(3)>,
  44. L<SSL_do_handshake(3)>,
  45. L<SSL_CTX_set_ssl_version(3)>
  46. =head1 COPYRIGHT
  47. Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
  48. Licensed under the Apache License 2.0 (the "License"). You may not use
  49. this file except in compliance with the License. You can obtain a copy
  50. in the file LICENSE in the source distribution or at
  51. L<https://www.openssl.org/source/license.html>.
  52. =cut