2
0

SSL_get_version.pod 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. =pod
  2. =head1 NAME
  3. SSL_client_version, SSL_get_version, SSL_is_dtls, SSL_version - get the
  4. protocol information of a connection
  5. =head1 SYNOPSIS
  6. #include <openssl/ssl.h>
  7. int SSL_client_version(const SSL *s);
  8. const char *SSL_get_version(const SSL *ssl);
  9. int SSL_is_dtls(const SSL *ssl);
  10. int SSL_version(const SSL *s);
  11. =head1 DESCRIPTION
  12. SSL_client_version() returns the protocol version used by the client when
  13. initiating the connection. SSL_get_version() returns the name of the protocol
  14. used for the connection. SSL_version() returns the protocol version used for the
  15. connection. They should only be called after the initial handshake has been
  16. completed. Prior to that the results returned from these functions may be
  17. unreliable.
  18. SSL_is_dtls() returns one if the connection is using DTLS, zero if not.
  19. =head1 RETURN VALUES
  20. SSL_get_version() returns one of the following strings:
  21. =over 4
  22. =item SSLv3
  23. The connection uses the SSLv3 protocol.
  24. =item TLSv1
  25. The connection uses the TLSv1.0 protocol.
  26. =item TLSv1.1
  27. The connection uses the TLSv1.1 protocol.
  28. =item TLSv1.2
  29. The connection uses the TLSv1.2 protocol.
  30. =item TLSv1.3
  31. The connection uses the TLSv1.3 protocol.
  32. =item unknown
  33. This indicates an unknown protocol version.
  34. =back
  35. SSL_version() and SSL_client_version() return an integer which could include any of
  36. the following:
  37. =over 4
  38. =item SSL3_VERSION
  39. The connection uses the SSLv3 protocol.
  40. =item TLS1_VERSION
  41. The connection uses the TLSv1.0 protocol.
  42. =item TLS1_1_VERSION
  43. The connection uses the TLSv1.1 protocol.
  44. =item TLS1_2_VERSION
  45. The connection uses the TLSv1.2 protocol.
  46. =item TLS1_3_VERSION
  47. The connection uses the TLSv1.3 protocol.
  48. =back
  49. =head1 SEE ALSO
  50. L<ssl(7)>
  51. =head1 HISTORY
  52. SSL_is_dtls() was added in OpenSSL 1.1.0.
  53. =head1 COPYRIGHT
  54. Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
  55. Licensed under the OpenSSL license (the "License"). You may not use
  56. this file except in compliance with the License. You can obtain a copy
  57. in the file LICENSE in the source distribution or at
  58. L<https://www.openssl.org/source/license.html>.
  59. =cut