ssl.pod 26 KB

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