SSL_set_session.pod 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. =pod
  2. =head1 NAME
  3. SSL_set_session - set a TLS/SSL session to be used during TLS/SSL connect
  4. =head1 SYNOPSIS
  5. #include <openssl/ssl.h>
  6. int SSL_set_session(SSL *ssl, SSL_SESSION *session);
  7. =head1 DESCRIPTION
  8. SSL_set_session() sets B<session> to be used when the TLS/SSL connection
  9. is to be established. SSL_set_session() is only useful for TLS/SSL clients.
  10. When the session is set, the reference count of B<session> is incremented
  11. by 1. If the session is not reused, the reference count is decremented
  12. again during SSL_connect(). Whether the session was reused can be queried
  13. with the L<SSL_session_reused(3)|SSL_session_reused(3)> call.
  14. If there is already a session set inside B<ssl> (because it was set with
  15. SSL_set_session() before or because the same B<ssl> was already used for
  16. a connection), SSL_SESSION_free() will be called for that session.
  17. =head1 NOTES
  18. SSL_SESSION objects keep internal link information about the session cache
  19. list, when being inserted into one SSL_CTX object's session cache.
  20. One SSL_SESSION object, regardless of its reference count, must therefore
  21. only be used with one SSL_CTX object (and the SSL objects created
  22. from this SSL_CTX object).
  23. =head1 RETURN VALUES
  24. The following return values can occur:
  25. =over 4
  26. =item 0
  27. The operation failed; check the error stack to find out the reason.
  28. =item 1
  29. The operation succeeded.
  30. =back
  31. =head1 SEE ALSO
  32. L<ssl(3)|ssl(3)>, L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>,
  33. L<SSL_get_session(3)|SSL_get_session(3)>,
  34. L<SSL_session_reused(3)|SSL_session_reused(3)>,
  35. L<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>
  36. =cut