ssl.pod 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. =pod
  2. =head1 NAME
  3. ssl - OpenSSL SSL/TLS library
  4. =head1 SYNOPSIS
  5. See the individual manual pages for details.
  6. =head1 DESCRIPTION
  7. The OpenSSL B<ssl> library implements the Secure Sockets Layer (SSL v2/v3) and
  8. Transport Layer Security (TLS v1) protocols. It provides a rich API which is
  9. documented here.
  10. An B<SSL_CTX> object is created as a framework to establish
  11. TLS/SSL enabled connections (see L<SSL_CTX_new(3)>).
  12. Various options regarding certificates, algorithms etc. can be set
  13. in this object.
  14. When a network connection has been created, it can be assigned to an
  15. B<SSL> object. After the B<SSL> object has been created using
  16. L<SSL_new(3)>, L<SSL_set_fd(3)> or
  17. L<SSL_set_bio(3)> can be used to associate the network
  18. connection with the object.
  19. When the TLS/SSL handshake is performed using
  20. L<SSL_accept(3)> or L<SSL_connect(3)>
  21. respectively.
  22. L<SSL_read_ex(3)>, L<SSL_read(3)>, L<SSL_write_ex(3)> and L<SSL_write(3)> are
  23. used to read and write data on the TLS/SSL connection.
  24. L<SSL_shutdown(3)> can be used to shut down the
  25. TLS/SSL connection.
  26. =head1 DATA STRUCTURES
  27. Currently the OpenSSL B<ssl> library functions deals with the following data
  28. structures:
  29. =over 4
  30. =item B<SSL_METHOD> (SSL Method)
  31. This is a dispatch structure describing the internal B<ssl> library
  32. methods/functions which implement the various protocol versions (SSLv3
  33. TLSv1, ...). It's needed to create an B<SSL_CTX>.
  34. =item B<SSL_CIPHER> (SSL Cipher)
  35. This structure holds the algorithm information for a particular cipher which
  36. are a core part of the SSL/TLS protocol. The available ciphers are configured
  37. on a B<SSL_CTX> basis and the actual ones used are then part of the
  38. B<SSL_SESSION>.
  39. =item B<SSL_CTX> (SSL Context)
  40. This is the global context structure which is created by a server or client
  41. once per program life-time and which holds mainly default values for the
  42. B<SSL> structures which are later created for the connections.
  43. =item B<SSL_SESSION> (SSL Session)
  44. This is a structure containing the current TLS/SSL session details for a
  45. connection: B<SSL_CIPHER>s, client and server certificates, keys, etc.
  46. =item B<SSL> (SSL Connection)
  47. This is the main SSL/TLS structure which is created by a server or client per
  48. established connection. This actually is the core structure in the SSL API.
  49. At run-time the application usually deals with this structure which has
  50. links to mostly all other structures.
  51. =back
  52. =head1 HEADER FILES
  53. Currently the OpenSSL B<ssl> library provides the following C header files
  54. containing the prototypes for the data structures and functions:
  55. =over 4
  56. =item B<ssl.h>
  57. This is the common header file for the SSL/TLS API. Include it into your
  58. program to make the API of the B<ssl> library available. It internally
  59. includes both more private SSL headers and headers from the B<crypto> library.
  60. Whenever you need hard-core details on the internals of the SSL API, look
  61. inside this header file.
  62. =item B<ssl2.h>
  63. Unused. Present for backwards compatibility only.
  64. =item B<ssl3.h>
  65. This is the sub header file dealing with the SSLv3 protocol only.
  66. I<Usually you don't have to include it explicitly because
  67. it's already included by ssl.h>.
  68. =item B<tls1.h>
  69. This is the sub header file dealing with the TLSv1 protocol only.
  70. I<Usually you don't have to include it explicitly because
  71. it's already included by ssl.h>.
  72. =back
  73. =head1 API FUNCTIONS
  74. Currently the OpenSSL B<ssl> library exports 214 API functions.
  75. They are documented in the following:
  76. =head2 Dealing with Protocol Methods
  77. Here we document the various API functions which deal with the SSL/TLS
  78. protocol methods defined in B<SSL_METHOD> structures.
  79. =over 4
  80. =item const SSL_METHOD *B<TLS_method>(void);
  81. Constructor for the I<version-flexible> SSL_METHOD structure for clients,
  82. servers or both.
  83. See L<SSL_CTX_new(3)> for details.
  84. =item const SSL_METHOD *B<TLS_client_method>(void);
  85. Constructor for the I<version-flexible> SSL_METHOD structure for clients.
  86. =item const SSL_METHOD *B<TLS_server_method>(void);
  87. Constructor for the I<version-flexible> SSL_METHOD structure for servers.
  88. =item const SSL_METHOD *B<TLSv1_2_method>(void);
  89. Constructor for the TLSv1.2 SSL_METHOD structure for clients, servers or both.
  90. =item const SSL_METHOD *B<TLSv1_2_client_method>(void);
  91. Constructor for the TLSv1.2 SSL_METHOD structure for clients.
  92. =item const SSL_METHOD *B<TLSv1_2_server_method>(void);
  93. Constructor for the TLSv1.2 SSL_METHOD structure for servers.
  94. =item const SSL_METHOD *B<TLSv1_1_method>(void);
  95. Constructor for the TLSv1.1 SSL_METHOD structure for clients, servers or both.
  96. =item const SSL_METHOD *B<TLSv1_1_client_method>(void);
  97. Constructor for the TLSv1.1 SSL_METHOD structure for clients.
  98. =item const SSL_METHOD *B<TLSv1_1_server_method>(void);
  99. Constructor for the TLSv1.1 SSL_METHOD structure for servers.
  100. =item const SSL_METHOD *B<TLSv1_method>(void);
  101. Constructor for the TLSv1 SSL_METHOD structure for clients, servers or both.
  102. =item const SSL_METHOD *B<TLSv1_client_method>(void);
  103. Constructor for the TLSv1 SSL_METHOD structure for clients.
  104. =item const SSL_METHOD *B<TLSv1_server_method>(void);
  105. Constructor for the TLSv1 SSL_METHOD structure for servers.
  106. =item const SSL_METHOD *B<SSLv3_method>(void);
  107. Constructor for the SSLv3 SSL_METHOD structure for clients, servers or both.
  108. =item const SSL_METHOD *B<SSLv3_client_method>(void);
  109. Constructor for the SSLv3 SSL_METHOD structure for clients.
  110. =item const SSL_METHOD *B<SSLv3_server_method>(void);
  111. Constructor for the SSLv3 SSL_METHOD structure for servers.
  112. =back
  113. =head2 Dealing with Ciphers
  114. Here we document the various API functions which deal with the SSL/TLS
  115. ciphers defined in B<SSL_CIPHER> structures.
  116. =over 4
  117. =item char *B<SSL_CIPHER_description>(SSL_CIPHER *cipher, char *buf, int len);
  118. Write a string to I<buf> (with a maximum size of I<len>) containing a human
  119. readable description of I<cipher>. Returns I<buf>.
  120. =item int B<SSL_CIPHER_get_bits>(SSL_CIPHER *cipher, int *alg_bits);
  121. Determine the number of bits in I<cipher>. Because of export crippled ciphers
  122. there are two bits: The bits the algorithm supports in general (stored to
  123. I<alg_bits>) and the bits which are actually used (the return value).
  124. =item const char *B<SSL_CIPHER_get_name>(SSL_CIPHER *cipher);
  125. Return the internal name of I<cipher> as a string. These are the various
  126. strings defined by the I<SSL3_TXT_xxx> and I<TLS1_TXT_xxx>
  127. definitions in the header files.
  128. =item const char *B<SSL_CIPHER_get_version>(SSL_CIPHER *cipher);
  129. Returns a string like "C<SSLv3>" or "C<TLSv1.2>" which indicates the
  130. SSL/TLS protocol version to which I<cipher> belongs (i.e. where it was defined
  131. in the specification the first time).
  132. =back
  133. =head2 Dealing with Protocol Contexts
  134. Here we document the various API functions which deal with the SSL/TLS
  135. protocol context defined in the B<SSL_CTX> structure.
  136. =over 4
  137. =item int B<SSL_CTX_add_client_CA>(SSL_CTX *ctx, X509 *x);
  138. =item long B<SSL_CTX_add_extra_chain_cert>(SSL_CTX *ctx, X509 *x509);
  139. =item int B<SSL_CTX_add_session>(SSL_CTX *ctx, SSL_SESSION *c);
  140. =item int B<SSL_CTX_check_private_key>(const SSL_CTX *ctx);
  141. =item long B<SSL_CTX_ctrl>(SSL_CTX *ctx, int cmd, long larg, char *parg);
  142. =item void B<SSL_CTX_flush_sessions>(SSL_CTX *s, long t);
  143. =item void B<SSL_CTX_free>(SSL_CTX *a);
  144. =item char *B<SSL_CTX_get_app_data>(SSL_CTX *ctx);
  145. =item X509_STORE *B<SSL_CTX_get_cert_store>(SSL_CTX *ctx);
  146. =item STACK *B<SSL_CTX_get_ciphers>(const SSL_CTX *ctx);
  147. =item STACK *B<SSL_CTX_get_client_CA_list>(const SSL_CTX *ctx);
  148. =item int (*B<SSL_CTX_get_client_cert_cb>(SSL_CTX *ctx))(SSL *ssl, X509 **x509, EVP_PKEY **pkey);
  149. =item void B<SSL_CTX_get_default_read_ahead>(SSL_CTX *ctx);
  150. =item char *B<SSL_CTX_get_ex_data>(const SSL_CTX *s, int idx);
  151. =item int B<SSL_CTX_get_ex_new_index>(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))
  152. =item void (*B<SSL_CTX_get_info_callback>(SSL_CTX *ctx))(SSL *ssl, int cb, int ret);
  153. =item int B<SSL_CTX_get_quiet_shutdown>(const SSL_CTX *ctx);
  154. =item void B<SSL_CTX_get_read_ahead>(SSL_CTX *ctx);
  155. =item int B<SSL_CTX_get_session_cache_mode>(SSL_CTX *ctx);
  156. =item long B<SSL_CTX_get_timeout>(const SSL_CTX *ctx);
  157. =item int (*B<SSL_CTX_get_verify_callback>(const SSL_CTX *ctx))(int ok, X509_STORE_CTX *ctx);
  158. =item int B<SSL_CTX_get_verify_mode>(SSL_CTX *ctx);
  159. =item int B<SSL_CTX_load_verify_locations>(SSL_CTX *ctx, const char *CAfile, const char *CApath);
  160. =item SSL_CTX *B<SSL_CTX_new>(const SSL_METHOD *meth);
  161. =item int SSL_CTX_up_ref(SSL_CTX *ctx);
  162. =item int B<SSL_CTX_remove_session>(SSL_CTX *ctx, SSL_SESSION *c);
  163. =item int B<SSL_CTX_sess_accept>(SSL_CTX *ctx);
  164. =item int B<SSL_CTX_sess_accept_good>(SSL_CTX *ctx);
  165. =item int B<SSL_CTX_sess_accept_renegotiate>(SSL_CTX *ctx);
  166. =item int B<SSL_CTX_sess_cache_full>(SSL_CTX *ctx);
  167. =item int B<SSL_CTX_sess_cb_hits>(SSL_CTX *ctx);
  168. =item int B<SSL_CTX_sess_connect>(SSL_CTX *ctx);
  169. =item int B<SSL_CTX_sess_connect_good>(SSL_CTX *ctx);
  170. =item int B<SSL_CTX_sess_connect_renegotiate>(SSL_CTX *ctx);
  171. =item int B<SSL_CTX_sess_get_cache_size>(SSL_CTX *ctx);
  172. =item SSL_SESSION *(*B<SSL_CTX_sess_get_get_cb>(SSL_CTX *ctx))(SSL *ssl, unsigned char *data, int len, int *copy);
  173. =item int (*B<SSL_CTX_sess_get_new_cb>(SSL_CTX *ctx)(SSL *ssl, SSL_SESSION *sess);
  174. =item void (*B<SSL_CTX_sess_get_remove_cb>(SSL_CTX *ctx)(SSL_CTX *ctx, SSL_SESSION *sess);
  175. =item int B<SSL_CTX_sess_hits>(SSL_CTX *ctx);
  176. =item int B<SSL_CTX_sess_misses>(SSL_CTX *ctx);
  177. =item int B<SSL_CTX_sess_number>(SSL_CTX *ctx);
  178. =item void B<SSL_CTX_sess_set_cache_size>(SSL_CTX *ctx, t);
  179. =item void B<SSL_CTX_sess_set_get_cb>(SSL_CTX *ctx, SSL_SESSION *(*cb)(SSL *ssl, unsigned char *data, int len, int *copy));
  180. =item void B<SSL_CTX_sess_set_new_cb>(SSL_CTX *ctx, int (*cb)(SSL *ssl, SSL_SESSION *sess));
  181. =item void B<SSL_CTX_sess_set_remove_cb>(SSL_CTX *ctx, void (*cb)(SSL_CTX *ctx, SSL_SESSION *sess));
  182. =item int B<SSL_CTX_sess_timeouts>(SSL_CTX *ctx);
  183. =item LHASH *B<SSL_CTX_sessions>(SSL_CTX *ctx);
  184. =item int B<SSL_CTX_set_app_data>(SSL_CTX *ctx, void *arg);
  185. =item void B<SSL_CTX_set_cert_store>(SSL_CTX *ctx, X509_STORE *cs);
  186. =item void B<SSL_CTX_set1_cert_store>(SSL_CTX *ctx, X509_STORE *cs);
  187. =item void B<SSL_CTX_set_cert_verify_cb>(SSL_CTX *ctx, int (*cb)(), char *arg)
  188. =item int B<SSL_CTX_set_cipher_list>(SSL_CTX *ctx, char *str);
  189. =item void B<SSL_CTX_set_client_CA_list>(SSL_CTX *ctx, STACK *list);
  190. =item void B<SSL_CTX_set_client_cert_cb>(SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey));
  191. =item int B<SSL_CTX_set_ct_validation_callback>(SSL_CTX *ctx, ssl_ct_validation_cb callback, void *arg);
  192. =item void B<SSL_CTX_set_default_passwd_cb>(SSL_CTX *ctx, int (*cb);(void))
  193. =item void B<SSL_CTX_set_default_read_ahead>(SSL_CTX *ctx, int m);
  194. =item int B<SSL_CTX_set_default_verify_paths>(SSL_CTX *ctx);
  195. Use the default paths to locate trusted CA certificates. There is one default
  196. directory path and one default file path. Both are set via this call.
  197. =item int B<SSL_CTX_set_default_verify_dir>(SSL_CTX *ctx)
  198. Use the default directory path to locate trusted CA certificates.
  199. =item int B<SSL_CTX_set_default_verify_file>(SSL_CTX *ctx)
  200. Use the file path to locate trusted CA certificates.
  201. =item int B<SSL_CTX_set_ex_data>(SSL_CTX *s, int idx, char *arg);
  202. =item void B<SSL_CTX_set_info_callback>(SSL_CTX *ctx, void (*cb)(SSL *ssl, int cb, int ret));
  203. =item void B<SSL_CTX_set_msg_callback>(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
  204. =item void B<SSL_CTX_set_msg_callback_arg>(SSL_CTX *ctx, void *arg);
  205. =item unsigned long B<SSL_CTX_clear_options>(SSL_CTX *ctx, unsigned long op);
  206. =item unsigned long B<SSL_CTX_get_options>(SSL_CTX *ctx);
  207. =item unsigned long B<SSL_CTX_set_options>(SSL_CTX *ctx, unsigned long op);
  208. =item void B<SSL_CTX_set_quiet_shutdown>(SSL_CTX *ctx, int mode);
  209. =item void B<SSL_CTX_set_read_ahead>(SSL_CTX *ctx, int m);
  210. =item void B<SSL_CTX_set_session_cache_mode>(SSL_CTX *ctx, int mode);
  211. =item int B<SSL_CTX_set_ssl_version>(SSL_CTX *ctx, const SSL_METHOD *meth);
  212. =item void B<SSL_CTX_set_timeout>(SSL_CTX *ctx, long t);
  213. =item long B<SSL_CTX_set_tmp_dh>(SSL_CTX* ctx, DH *dh);
  214. =item long B<SSL_CTX_set_tmp_dh_callback>(SSL_CTX *ctx, DH *(*cb)(void));
  215. =item void B<SSL_CTX_set_verify>(SSL_CTX *ctx, int mode, int (*cb);(void))
  216. =item int B<SSL_CTX_use_PrivateKey>(SSL_CTX *ctx, EVP_PKEY *pkey);
  217. =item int B<SSL_CTX_use_PrivateKey_ASN1>(int type, SSL_CTX *ctx, unsigned char *d, long len);
  218. =item int B<SSL_CTX_use_PrivateKey_file>(SSL_CTX *ctx, const char *file, int type);
  219. =item int B<SSL_CTX_use_RSAPrivateKey>(SSL_CTX *ctx, RSA *rsa);
  220. =item int B<SSL_CTX_use_RSAPrivateKey_ASN1>(SSL_CTX *ctx, unsigned char *d, long len);
  221. =item int B<SSL_CTX_use_RSAPrivateKey_file>(SSL_CTX *ctx, const char *file, int type);
  222. =item int B<SSL_CTX_use_certificate>(SSL_CTX *ctx, X509 *x);
  223. =item int B<SSL_CTX_use_certificate_ASN1>(SSL_CTX *ctx, int len, unsigned char *d);
  224. =item int B<SSL_CTX_use_certificate_file>(SSL_CTX *ctx, const char *file, int type);
  225. =item int B<SSL_CTX_use_cert_and_key>(SSL_CTX *ctx, X509 *x, EVP_PKEY *pkey, STACK_OF(X509) *chain, int override);
  226. =item X509 *B<SSL_CTX_get0_certificate>(const SSL_CTX *ctx);
  227. =item EVP_PKEY *B<SSL_CTX_get0_privatekey>(const SSL_CTX *ctx);
  228. =item void B<SSL_CTX_set_psk_client_callback>(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len));
  229. =item int B<SSL_CTX_use_psk_identity_hint>(SSL_CTX *ctx, const char *hint);
  230. =item void B<SSL_CTX_set_psk_server_callback>(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));
  231. =back
  232. =head2 Dealing with Sessions
  233. Here we document the various API functions which deal with the SSL/TLS
  234. sessions defined in the B<SSL_SESSION> structures.
  235. =over 4
  236. =item int B<SSL_SESSION_cmp>(const SSL_SESSION *a, const SSL_SESSION *b);
  237. =item void B<SSL_SESSION_free>(SSL_SESSION *ss);
  238. =item char *B<SSL_SESSION_get_app_data>(SSL_SESSION *s);
  239. =item char *B<SSL_SESSION_get_ex_data>(const SSL_SESSION *s, int idx);
  240. =item int B<SSL_SESSION_get_ex_new_index>(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))
  241. =item long B<SSL_SESSION_get_time>(const SSL_SESSION *s);
  242. =item long B<SSL_SESSION_get_timeout>(const SSL_SESSION *s);
  243. =item unsigned long B<SSL_SESSION_hash>(const SSL_SESSION *a);
  244. =item SSL_SESSION *B<SSL_SESSION_new>(void);
  245. =item int B<SSL_SESSION_print>(BIO *bp, const SSL_SESSION *x);
  246. =item int B<SSL_SESSION_print_fp>(FILE *fp, const SSL_SESSION *x);
  247. =item int B<SSL_SESSION_set_app_data>(SSL_SESSION *s, char *a);
  248. =item int B<SSL_SESSION_set_ex_data>(SSL_SESSION *s, int idx, char *arg);
  249. =item long B<SSL_SESSION_set_time>(SSL_SESSION *s, long t);
  250. =item long B<SSL_SESSION_set_timeout>(SSL_SESSION *s, long t);
  251. =back
  252. =head2 Dealing with Connections
  253. Here we document the various API functions which deal with the SSL/TLS
  254. connection defined in the B<SSL> structure.
  255. =over 4
  256. =item int B<SSL_accept>(SSL *ssl);
  257. =item int B<SSL_add_dir_cert_subjects_to_stack>(STACK *stack, const char *dir);
  258. =item int B<SSL_add_file_cert_subjects_to_stack>(STACK *stack, const char *file);
  259. =item int B<SSL_add_client_CA>(SSL *ssl, X509 *x);
  260. =item char *B<SSL_alert_desc_string>(int value);
  261. =item char *B<SSL_alert_desc_string_long>(int value);
  262. =item char *B<SSL_alert_type_string>(int value);
  263. =item char *B<SSL_alert_type_string_long>(int value);
  264. =item int B<SSL_check_private_key>(const SSL *ssl);
  265. =item void B<SSL_clear>(SSL *ssl);
  266. =item long B<SSL_clear_num_renegotiations>(SSL *ssl);
  267. =item int B<SSL_connect>(SSL *ssl);
  268. =item int B<SSL_copy_session_id>(SSL *t, const SSL *f);
  269. Sets the session details for B<t> to be the same as in B<f>. Returns 1 on
  270. success or 0 on failure.
  271. =item long B<SSL_ctrl>(SSL *ssl, int cmd, long larg, char *parg);
  272. =item int B<SSL_do_handshake>(SSL *ssl);
  273. =item SSL *B<SSL_dup>(SSL *ssl);
  274. SSL_dup() allows applications to configure an SSL handle for use
  275. in multiple SSL connections, and then duplicate it prior to initiating
  276. each connection with the duplicated handle.
  277. Use of SSL_dup() avoids the need to repeat the configuration of the
  278. handles for each connection.
  279. For SSL_dup() to work, the connection MUST be in its initial state
  280. and MUST NOT have not yet have started the SSL handshake.
  281. For connections that are not in their initial state SSL_dup() just
  282. increments an internal reference count and returns the I<same>
  283. handle.
  284. It may be possible to use L<SSL_clear(3)> to recycle an SSL handle
  285. that is not in its initial state for re-use, but this is best
  286. avoided.
  287. Instead, save and restore the session, if desired, and construct a
  288. fresh handle for each connection.
  289. =item STACK *B<SSL_dup_CA_list>(STACK *sk);
  290. =item void B<SSL_free>(SSL *ssl);
  291. =item SSL_CTX *B<SSL_get_SSL_CTX>(const SSL *ssl);
  292. =item char *B<SSL_get_app_data>(SSL *ssl);
  293. =item X509 *B<SSL_get_certificate>(const SSL *ssl);
  294. =item const char *B<SSL_get_cipher>(const SSL *ssl);
  295. =item int B<SSL_is_dtls>(const SSL *ssl);
  296. =item int B<SSL_get_cipher_bits>(const SSL *ssl, int *alg_bits);
  297. =item char *B<SSL_get_cipher_list>(const SSL *ssl, int n);
  298. =item char *B<SSL_get_cipher_name>(const SSL *ssl);
  299. =item char *B<SSL_get_cipher_version>(const SSL *ssl);
  300. =item STACK *B<SSL_get_ciphers>(const SSL *ssl);
  301. =item STACK *B<SSL_get_client_CA_list>(const SSL *ssl);
  302. =item SSL_CIPHER *B<SSL_get_current_cipher>(SSL *ssl);
  303. =item long B<SSL_get_default_timeout>(const SSL *ssl);
  304. =item int B<SSL_get_error>(const SSL *ssl, int i);
  305. =item char *B<SSL_get_ex_data>(const SSL *ssl, int idx);
  306. =item int B<SSL_get_ex_data_X509_STORE_CTX_idx>(void);
  307. =item int B<SSL_get_ex_new_index>(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))
  308. =item int B<SSL_get_fd>(const SSL *ssl);
  309. =item void (*B<SSL_get_info_callback>(const SSL *ssl);)()
  310. =item int B<SSL_get_key_update_type>(SSL *s);
  311. =item STACK *B<SSL_get_peer_cert_chain>(const SSL *ssl);
  312. =item X509 *B<SSL_get_peer_certificate>(const SSL *ssl);
  313. =item const STACK_OF(SCT) *B<SSL_get0_peer_scts>(SSL *s);
  314. =item EVP_PKEY *B<SSL_get_privatekey>(const SSL *ssl);
  315. =item int B<SSL_get_quiet_shutdown>(const SSL *ssl);
  316. =item BIO *B<SSL_get_rbio>(const SSL *ssl);
  317. =item int B<SSL_get_read_ahead>(const SSL *ssl);
  318. =item SSL_SESSION *B<SSL_get_session>(const SSL *ssl);
  319. =item char *B<SSL_get_shared_ciphers>(const SSL *ssl, char *buf, int size);
  320. =item int B<SSL_get_shutdown>(const SSL *ssl);
  321. =item const SSL_METHOD *B<SSL_get_ssl_method>(SSL *ssl);
  322. =item int B<SSL_get_state>(const SSL *ssl);
  323. =item long B<SSL_get_time>(const SSL *ssl);
  324. =item long B<SSL_get_timeout>(const SSL *ssl);
  325. =item int (*B<SSL_get_verify_callback>(const SSL *ssl))(int, X509_STORE_CTX *)
  326. =item int B<SSL_get_verify_mode>(const SSL *ssl);
  327. =item long B<SSL_get_verify_result>(const SSL *ssl);
  328. =item char *B<SSL_get_version>(const SSL *ssl);
  329. =item BIO *B<SSL_get_wbio>(const SSL *ssl);
  330. =item int B<SSL_in_accept_init>(SSL *ssl);
  331. =item int B<SSL_in_before>(SSL *ssl);
  332. =item int B<SSL_in_connect_init>(SSL *ssl);
  333. =item int B<SSL_in_init>(SSL *ssl);
  334. =item int B<SSL_is_init_finished>(SSL *ssl);
  335. =item int B<SSL_key_update>(SSL *s, int updatetype);
  336. =item STACK *B<SSL_load_client_CA_file>(const char *file);
  337. =item SSL *B<SSL_new>(SSL_CTX *ctx);
  338. =item int SSL_up_ref(SSL *s);
  339. =item long B<SSL_num_renegotiations>(SSL *ssl);
  340. =item int B<SSL_peek>(SSL *ssl, void *buf, int num);
  341. =item int B<SSL_pending>(const SSL *ssl);
  342. =item int B<SSL_read>(SSL *ssl, void *buf, int num);
  343. =item int B<SSL_renegotiate>(SSL *ssl);
  344. =item char *B<SSL_rstate_string>(SSL *ssl);
  345. =item char *B<SSL_rstate_string_long>(SSL *ssl);
  346. =item long B<SSL_session_reused>(SSL *ssl);
  347. =item void B<SSL_set_accept_state>(SSL *ssl);
  348. =item void B<SSL_set_app_data>(SSL *ssl, char *arg);
  349. =item void B<SSL_set_bio>(SSL *ssl, BIO *rbio, BIO *wbio);
  350. =item int B<SSL_set_cipher_list>(SSL *ssl, char *str);
  351. =item void B<SSL_set_client_CA_list>(SSL *ssl, STACK *list);
  352. =item void B<SSL_set_connect_state>(SSL *ssl);
  353. =item int B<SSL_set_ct_validation_callback>(SSL *ssl, ssl_ct_validation_cb callback, void *arg);
  354. =item int B<SSL_set_ex_data>(SSL *ssl, int idx, char *arg);
  355. =item int B<SSL_set_fd>(SSL *ssl, int fd);
  356. =item void B<SSL_set_info_callback>(SSL *ssl, void (*cb);(void))
  357. =item void B<SSL_set_msg_callback>(SSL *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
  358. =item void B<SSL_set_msg_callback_arg>(SSL *ctx, void *arg);
  359. =item unsigned long B<SSL_clear_options>(SSL *ssl, unsigned long op);
  360. =item unsigned long B<SSL_get_options>(SSL *ssl);
  361. =item unsigned long B<SSL_set_options>(SSL *ssl, unsigned long op);
  362. =item void B<SSL_set_quiet_shutdown>(SSL *ssl, int mode);
  363. =item void B<SSL_set_read_ahead>(SSL *ssl, int yes);
  364. =item int B<SSL_set_rfd>(SSL *ssl, int fd);
  365. =item int B<SSL_set_session>(SSL *ssl, SSL_SESSION *session);
  366. =item void B<SSL_set_shutdown>(SSL *ssl, int mode);
  367. =item int B<SSL_set_ssl_method>(SSL *ssl, const SSL_METHOD *meth);
  368. =item void B<SSL_set_time>(SSL *ssl, long t);
  369. =item void B<SSL_set_timeout>(SSL *ssl, long t);
  370. =item void B<SSL_set_verify>(SSL *ssl, int mode, int (*callback);(void))
  371. =item void B<SSL_set_verify_result>(SSL *ssl, long arg);
  372. =item int B<SSL_set_wfd>(SSL *ssl, int fd);
  373. =item int B<SSL_shutdown>(SSL *ssl);
  374. =item OSSL_HANDSHAKE_STATE B<SSL_get_state>(const SSL *ssl);
  375. Returns the current handshake state.
  376. =item char *B<SSL_state_string>(const SSL *ssl);
  377. =item char *B<SSL_state_string_long>(const SSL *ssl);
  378. =item long B<SSL_total_renegotiations>(SSL *ssl);
  379. =item int B<SSL_use_PrivateKey>(SSL *ssl, EVP_PKEY *pkey);
  380. =item int B<SSL_use_PrivateKey_ASN1>(int type, SSL *ssl, unsigned char *d, long len);
  381. =item int B<SSL_use_PrivateKey_file>(SSL *ssl, const char *file, int type);
  382. =item int B<SSL_use_RSAPrivateKey>(SSL *ssl, RSA *rsa);
  383. =item int B<SSL_use_RSAPrivateKey_ASN1>(SSL *ssl, unsigned char *d, long len);
  384. =item int B<SSL_use_RSAPrivateKey_file>(SSL *ssl, const char *file, int type);
  385. =item int B<SSL_use_certificate>(SSL *ssl, X509 *x);
  386. =item int B<SSL_use_certificate_ASN1>(SSL *ssl, int len, unsigned char *d);
  387. =item int B<SSL_use_certificate_file>(SSL *ssl, const char *file, int type);
  388. =item int B<SSL_use_cert_and_key>(SSL *ssl, X509 *x, EVP_PKEY *pkey, STACK_OF(X509) *chain, int override);
  389. =item int B<SSL_version>(const SSL *ssl);
  390. =item int B<SSL_want>(const SSL *ssl);
  391. =item int B<SSL_want_nothing>(const SSL *ssl);
  392. =item int B<SSL_want_read>(const SSL *ssl);
  393. =item int B<SSL_want_write>(const SSL *ssl);
  394. =item int B<SSL_want_x509_lookup>(const SSL *ssl);
  395. =item int B<SSL_write>(SSL *ssl, const void *buf, int num);
  396. =item void B<SSL_set_psk_client_callback>(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len));
  397. =item int B<SSL_use_psk_identity_hint>(SSL *ssl, const char *hint);
  398. =item void B<SSL_set_psk_server_callback>(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));
  399. =item const char *B<SSL_get_psk_identity_hint>(SSL *ssl);
  400. =item const char *B<SSL_get_psk_identity>(SSL *ssl);
  401. =back
  402. =head1 RETURN VALUES
  403. See the individual manual pages for details.
  404. =head1 SEE ALSO
  405. L<openssl(1)>, L<crypto(7)>,
  406. L<CRYPTO_get_ex_new_index(3)>,
  407. L<SSL_accept(3)>, L<SSL_clear(3)>,
  408. L<SSL_connect(3)>,
  409. L<SSL_CIPHER_get_name(3)>,
  410. L<SSL_COMP_add_compression_method(3)>,
  411. L<SSL_CTX_add_extra_chain_cert(3)>,
  412. L<SSL_CTX_add_session(3)>,
  413. L<SSL_CTX_ctrl(3)>,
  414. L<SSL_CTX_flush_sessions(3)>,
  415. L<SSL_CTX_get_verify_mode(3)>,
  416. L<SSL_CTX_load_verify_locations(3)>
  417. L<SSL_CTX_new(3)>,
  418. L<SSL_CTX_sess_number(3)>,
  419. L<SSL_CTX_sess_set_cache_size(3)>,
  420. L<SSL_CTX_sess_set_get_cb(3)>,
  421. L<SSL_CTX_sessions(3)>,
  422. L<SSL_CTX_set_cert_store(3)>,
  423. L<SSL_CTX_set_cert_verify_callback(3)>,
  424. L<SSL_CTX_set_cipher_list(3)>,
  425. L<SSL_CTX_set_client_CA_list(3)>,
  426. L<SSL_CTX_set_client_cert_cb(3)>,
  427. L<SSL_CTX_set_default_passwd_cb(3)>,
  428. L<SSL_CTX_set_generate_session_id(3)>,
  429. L<SSL_CTX_set_info_callback(3)>,
  430. L<SSL_CTX_set_max_cert_list(3)>,
  431. L<SSL_CTX_set_mode(3)>,
  432. L<SSL_CTX_set_msg_callback(3)>,
  433. L<SSL_CTX_set_options(3)>,
  434. L<SSL_CTX_set_quiet_shutdown(3)>,
  435. L<SSL_CTX_set_read_ahead(3)>,
  436. L<SSL_CTX_set_security_level(3)>,
  437. L<SSL_CTX_set_session_cache_mode(3)>,
  438. L<SSL_CTX_set_session_id_context(3)>,
  439. L<SSL_CTX_set_ssl_version(3)>,
  440. L<SSL_CTX_set_timeout(3)>,
  441. L<SSL_CTX_set_tmp_dh_callback(3)>,
  442. L<SSL_CTX_set_verify(3)>,
  443. L<SSL_CTX_use_certificate(3)>,
  444. L<SSL_alert_type_string(3)>,
  445. L<SSL_do_handshake(3)>,
  446. L<SSL_enable_ct(3)>,
  447. L<SSL_get_SSL_CTX(3)>,
  448. L<SSL_get_ciphers(3)>,
  449. L<SSL_get_client_CA_list(3)>,
  450. L<SSL_get_default_timeout(3)>,
  451. L<SSL_get_error(3)>,
  452. L<SSL_get_ex_data_X509_STORE_CTX_idx(3)>,
  453. L<SSL_get_fd(3)>,
  454. L<SSL_get_peer_cert_chain(3)>,
  455. L<SSL_get_rbio(3)>,
  456. L<SSL_get_session(3)>,
  457. L<SSL_get_verify_result(3)>,
  458. L<SSL_get_version(3)>,
  459. L<SSL_load_client_CA_file(3)>,
  460. L<SSL_new(3)>,
  461. L<SSL_pending(3)>,
  462. L<SSL_read_ex(3)>,
  463. L<SSL_read(3)>,
  464. L<SSL_rstate_string(3)>,
  465. L<SSL_session_reused(3)>,
  466. L<SSL_set_bio(3)>,
  467. L<SSL_set_connect_state(3)>,
  468. L<SSL_set_fd(3)>,
  469. L<SSL_set_session(3)>,
  470. L<SSL_set_shutdown(3)>,
  471. L<SSL_shutdown(3)>,
  472. L<SSL_state_string(3)>,
  473. L<SSL_want(3)>,
  474. L<SSL_write_ex(3)>,
  475. L<SSL_write(3)>,
  476. L<SSL_SESSION_free(3)>,
  477. L<SSL_SESSION_get_time(3)>,
  478. L<d2i_SSL_SESSION(3)>,
  479. L<SSL_CTX_set_psk_client_callback(3)>,
  480. L<SSL_CTX_use_psk_identity_hint(3)>,
  481. L<SSL_get_psk_identity(3)>,
  482. L<DTLSv1_listen(3)>
  483. =head1 HISTORY
  484. B<SSLv2_client_method>, B<SSLv2_server_method> and B<SSLv2_method> were removed
  485. in OpenSSL 1.1.0.
  486. The return type of B<SSL_copy_session_id> was changed from void to int in
  487. OpenSSL 1.1.0.
  488. =head1 COPYRIGHT
  489. Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
  490. Licensed under the OpenSSL license (the "License"). You may not use
  491. this file except in compliance with the License. You can obtain a copy
  492. in the file LICENSE in the source distribution or at
  493. L<https://www.openssl.org/source/license.html>.
  494. =cut