2
0

SSL_SESSION_get_time.pod 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. =pod
  2. =head1 NAME
  3. SSL_SESSION_get_time, SSL_SESSION_set_time, SSL_SESSION_get_timeout,
  4. SSL_SESSION_set_timeout, SSL_SESSION_get_time_ex, SSL_SESSION_set_time_ex,
  5. SSL_get_time, SSL_set_time, SSL_get_timeout, SSL_set_timeout
  6. - retrieve and manipulate session time and timeout settings
  7. =head1 SYNOPSIS
  8. #include <openssl/ssl.h>
  9. long SSL_SESSION_get_time(const SSL_SESSION *s);
  10. long SSL_SESSION_set_time(SSL_SESSION *s, long tm);
  11. long SSL_SESSION_get_timeout(const SSL_SESSION *s);
  12. long SSL_SESSION_set_timeout(SSL_SESSION *s, long tm);
  13. long SSL_get_time(const SSL_SESSION *s);
  14. long SSL_set_time(SSL_SESSION *s, long tm);
  15. long SSL_get_timeout(const SSL_SESSION *s);
  16. long SSL_set_timeout(SSL_SESSION *s, long tm);
  17. time_t SSL_SESSION_get_time_ex(const SSL_SESSION *s);
  18. time_t SSL_SESSION_set_time_ex(SSL_SESSION *s, time_t tm);
  19. =head1 DESCRIPTION
  20. SSL_SESSION_get_time() returns the time at which the session B<s> was
  21. established. The time is given in seconds since the Epoch and therefore
  22. compatible to the time delivered by the time() call.
  23. SSL_SESSION_set_time() replaces the creation time of the session B<s> with
  24. the chosen value B<tm>.
  25. SSL_SESSION_get_timeout() returns the timeout value set for session B<s>
  26. in seconds.
  27. SSL_SESSION_set_timeout() sets the timeout value for session B<s> in seconds
  28. to B<tm>.
  29. SSL_SESSION_get_time_ex() and SSL_SESSION_set_time_ex() extended functions use
  30. the time_t datatype instead of long to fix the Y2038 problem on systems with
  31. 64 bit time_t type.
  32. The SSL_get_time(), SSL_set_time(), SSL_get_timeout(), and SSL_set_timeout()
  33. functions are synonyms for the SSL_SESSION_*() counterparts.
  34. =head1 NOTES
  35. Sessions are expired by examining the creation time and the timeout value.
  36. Both are set at creation time of the session to the actual time and the
  37. default timeout value at creation, respectively, as set by
  38. L<SSL_CTX_set_timeout(3)>.
  39. Using these functions it is possible to extend or shorten the lifetime
  40. of the session.
  41. =head1 RETURN VALUES
  42. SSL_SESSION_get_time() and SSL_SESSION_get_timeout() return the currently
  43. valid values.
  44. SSL_SESSION_set_time() and SSL_SESSION_set_timeout() return 1 on success.
  45. If any of the function is passed the NULL pointer for the session B<s>,
  46. 0 is returned.
  47. =head1 BUGS
  48. The data type long is typically 32 bits on many systems, hence the old
  49. functions SSL_SESSION_get_time() and SSL_SESSION_set_time() are not always
  50. Y2038 safe.
  51. =head1 SEE ALSO
  52. L<ssl(7)>,
  53. L<SSL_CTX_set_timeout(3)>,
  54. L<SSL_get_default_timeout(3)>
  55. =head1 COPYRIGHT
  56. Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
  57. Licensed under the Apache License 2.0 (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