ssl.pod 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  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<SSLv2_client_method>(void);
  89. Constructor for the SSLv2 SSL_METHOD structure for a dedicated client.
  90. =item const SSL_METHOD *B<SSLv2_server_method>(void);
  91. Constructor for the SSLv2 SSL_METHOD structure for a dedicated server.
  92. =item const SSL_METHOD *B<SSLv2_method>(void);
  93. Constructor for the SSLv2 SSL_METHOD structure for combined client and server.
  94. =item const SSL_METHOD *B<SSLv3_client_method>(void);
  95. Constructor for the SSLv3 SSL_METHOD structure for a dedicated client.
  96. =item const SSL_METHOD *B<SSLv3_server_method>(void);
  97. Constructor for the SSLv3 SSL_METHOD structure for a dedicated server.
  98. =item const SSL_METHOD *B<SSLv3_method>(void);
  99. Constructor for the SSLv3 SSL_METHOD structure for combined client and server.
  100. =item const SSL_METHOD *B<TLSv1_client_method>(void);
  101. Constructor for the TLSv1 SSL_METHOD structure for a dedicated client.
  102. =item cosnt SSL_METHOD *B<TLSv1_server_method>(void);
  103. Constructor for the TLSv1 SSL_METHOD structure for a dedicated server.
  104. =item const SSL_METHOD *B<TLSv1_method>(void);
  105. Constructor for the TLSv1 SSL_METHOD structure for combined client and server.
  106. =back
  107. =head2 DEALING WITH CIPHERS
  108. Here we document the various API functions which deal with the SSL/TLS
  109. ciphers defined in B<SSL_CIPHER> structures.
  110. =over 4
  111. =item char *B<SSL_CIPHER_description>(SSL_CIPHER *cipher, char *buf, int len);
  112. Write a string to I<buf> (with a maximum size of I<len>) containing a human
  113. readable description of I<cipher>. Returns I<buf>.
  114. =item int B<SSL_CIPHER_get_bits>(SSL_CIPHER *cipher, int *alg_bits);
  115. Determine the number of bits in I<cipher>. Because of export crippled ciphers
  116. there are two bits: The bits the algorithm supports in general (stored to
  117. I<alg_bits>) and the bits which are actually used (the return value).
  118. =item const char *B<SSL_CIPHER_get_name>(SSL_CIPHER *cipher);
  119. Return the internal name of I<cipher> as a string. These are the various
  120. strings defined by the I<SSL2_TXT_xxx>, I<SSL3_TXT_xxx> and I<TLS1_TXT_xxx>
  121. definitions in the header files.
  122. =item char *B<SSL_CIPHER_get_version>(SSL_CIPHER *cipher);
  123. Returns a string like "C<TLSv1/SSLv3>" or "C<SSLv2>" which indicates the
  124. SSL/TLS protocol version to which I<cipher> belongs (i.e. where it was defined
  125. in the specification the first time).
  126. =back
  127. =head2 DEALING WITH PROTOCOL CONTEXTS
  128. Here we document the various API functions which deal with the SSL/TLS
  129. protocol context defined in the B<SSL_CTX> structure.
  130. =over 4
  131. =item int B<SSL_CTX_add_client_CA>(SSL_CTX *ctx, X509 *x);
  132. =item long B<SSL_CTX_add_extra_chain_cert>(SSL_CTX *ctx, X509 *x509);
  133. =item int B<SSL_CTX_add_session>(SSL_CTX *ctx, SSL_SESSION *c);
  134. =item int B<SSL_CTX_check_private_key>(const SSL_CTX *ctx);
  135. =item long B<SSL_CTX_ctrl>(SSL_CTX *ctx, int cmd, long larg, char *parg);
  136. =item void B<SSL_CTX_flush_sessions>(SSL_CTX *s, long t);
  137. =item void B<SSL_CTX_free>(SSL_CTX *a);
  138. =item char *B<SSL_CTX_get_app_data>(SSL_CTX *ctx);
  139. =item X509_STORE *B<SSL_CTX_get_cert_store>(SSL_CTX *ctx);
  140. =item STACK *B<SSL_CTX_get_client_CA_list>(const SSL_CTX *ctx);
  141. =item int (*B<SSL_CTX_get_client_cert_cb>(SSL_CTX *ctx))(SSL *ssl, X509 **x509, EVP_PKEY **pkey);
  142. =item char *B<SSL_CTX_get_ex_data>(const SSL_CTX *s, int idx);
  143. =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))
  144. =item void (*B<SSL_CTX_get_info_callback>(SSL_CTX *ctx))(SSL *ssl, int cb, int ret);
  145. =item int B<SSL_CTX_get_quiet_shutdown>(const SSL_CTX *ctx);
  146. =item int B<SSL_CTX_get_session_cache_mode>(SSL_CTX *ctx);
  147. =item long B<SSL_CTX_get_timeout>(const SSL_CTX *ctx);
  148. =item int (*B<SSL_CTX_get_verify_callback>(const SSL_CTX *ctx))(int ok, X509_STORE_CTX *ctx);
  149. =item int B<SSL_CTX_get_verify_mode>(SSL_CTX *ctx);
  150. =item int B<SSL_CTX_load_verify_locations>(SSL_CTX *ctx, char *CAfile, char *CApath);
  151. =item long B<SSL_CTX_need_tmp_RSA>(SSL_CTX *ctx);
  152. =item SSL_CTX *B<SSL_CTX_new>(const SSL_METHOD *meth);
  153. =item int B<SSL_CTX_remove_session>(SSL_CTX *ctx, SSL_SESSION *c);
  154. =item int B<SSL_CTX_sess_accept>(SSL_CTX *ctx);
  155. =item int B<SSL_CTX_sess_accept_good>(SSL_CTX *ctx);
  156. =item int B<SSL_CTX_sess_accept_renegotiate>(SSL_CTX *ctx);
  157. =item int B<SSL_CTX_sess_cache_full>(SSL_CTX *ctx);
  158. =item int B<SSL_CTX_sess_cb_hits>(SSL_CTX *ctx);
  159. =item int B<SSL_CTX_sess_connect>(SSL_CTX *ctx);
  160. =item int B<SSL_CTX_sess_connect_good>(SSL_CTX *ctx);
  161. =item int B<SSL_CTX_sess_connect_renegotiate>(SSL_CTX *ctx);
  162. =item int B<SSL_CTX_sess_get_cache_size>(SSL_CTX *ctx);
  163. =item SSL_SESSION *(*B<SSL_CTX_sess_get_get_cb>(SSL_CTX *ctx))(SSL *ssl, unsigned char *data, int len, int *copy);
  164. =item int (*B<SSL_CTX_sess_get_new_cb>(SSL_CTX *ctx)(SSL *ssl, SSL_SESSION *sess);
  165. =item void (*B<SSL_CTX_sess_get_remove_cb>(SSL_CTX *ctx)(SSL_CTX *ctx, SSL_SESSION *sess);
  166. =item int B<SSL_CTX_sess_hits>(SSL_CTX *ctx);
  167. =item int B<SSL_CTX_sess_misses>(SSL_CTX *ctx);
  168. =item int B<SSL_CTX_sess_number>(SSL_CTX *ctx);
  169. =item void B<SSL_CTX_sess_set_cache_size>(SSL_CTX *ctx,t);
  170. =item void B<SSL_CTX_sess_set_get_cb>(SSL_CTX *ctx, SSL_SESSION *(*cb)(SSL *ssl, unsigned char *data, int len, int *copy));
  171. =item void B<SSL_CTX_sess_set_new_cb>(SSL_CTX *ctx, int (*cb)(SSL *ssl, SSL_SESSION *sess));
  172. =item void B<SSL_CTX_sess_set_remove_cb>(SSL_CTX *ctx, void (*cb)(SSL_CTX *ctx, SSL_SESSION *sess));
  173. =item int B<SSL_CTX_sess_timeouts>(SSL_CTX *ctx);
  174. =item LHASH *B<SSL_CTX_sessions>(SSL_CTX *ctx);
  175. =item void B<SSL_CTX_set_app_data>(SSL_CTX *ctx, void *arg);
  176. =item void B<SSL_CTX_set_cert_store>(SSL_CTX *ctx, X509_STORE *cs);
  177. =item void B<SSL_CTX_set_cert_verify_cb>(SSL_CTX *ctx, int (*cb)(), char *arg)
  178. =item int B<SSL_CTX_set_cipher_list>(SSL_CTX *ctx, char *str);
  179. =item void B<SSL_CTX_set_client_CA_list>(SSL_CTX *ctx, STACK *list);
  180. =item void B<SSL_CTX_set_client_cert_cb>(SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey));
  181. =item void B<SSL_CTX_set_default_passwd_cb>(SSL_CTX *ctx, int (*cb);(void))
  182. =item void B<SSL_CTX_set_default_read_ahead>(SSL_CTX *ctx, int m);
  183. =item int B<SSL_CTX_set_default_verify_paths>(SSL_CTX *ctx);
  184. =item int B<SSL_CTX_set_ex_data>(SSL_CTX *s, int idx, char *arg);
  185. =item void B<SSL_CTX_set_info_callback>(SSL_CTX *ctx, void (*cb)(SSL *ssl, int cb, int ret));
  186. =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));
  187. =item void B<SSL_CTX_set_msg_callback_arg>(SSL_CTX *ctx, void *arg);
  188. =item void B<SSL_CTX_set_options>(SSL_CTX *ctx, unsigned long op);
  189. =item void B<SSL_CTX_set_quiet_shutdown>(SSL_CTX *ctx, int mode);
  190. =item void B<SSL_CTX_set_session_cache_mode>(SSL_CTX *ctx, int mode);
  191. =item int B<SSL_CTX_set_ssl_version>(SSL_CTX *ctx, const SSL_METHOD *meth);
  192. =item void B<SSL_CTX_set_timeout>(SSL_CTX *ctx, long t);
  193. =item long B<SSL_CTX_set_tmp_dh>(SSL_CTX* ctx, DH *dh);
  194. =item long B<SSL_CTX_set_tmp_dh_callback>(SSL_CTX *ctx, DH *(*cb)(void));
  195. =item long B<SSL_CTX_set_tmp_rsa>(SSL_CTX *ctx, RSA *rsa);
  196. =item SSL_CTX_set_tmp_rsa_callback
  197. 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>));>
  198. Sets the callback which will be called when a temporary private key is
  199. required. The B<C<export>> flag will be set if the reason for needing
  200. a temp key is that an export ciphersuite is in use, in which case,
  201. B<C<keylength>> will contain the required keylength in bits. Generate a key of
  202. appropriate size (using ???) and return it.
  203. =item SSL_set_tmp_rsa_callback
  204. long B<SSL_set_tmp_rsa_callback>(SSL *ssl, RSA *(*cb)(SSL *ssl, int export, int keylength));
  205. The same as B<SSL_CTX_set_tmp_rsa_callback>, except it operates on an SSL
  206. session instead of a context.
  207. =item void B<SSL_CTX_set_verify>(SSL_CTX *ctx, int mode, int (*cb);(void))
  208. =item int B<SSL_CTX_use_PrivateKey>(SSL_CTX *ctx, EVP_PKEY *pkey);
  209. =item int B<SSL_CTX_use_PrivateKey_ASN1>(int type, SSL_CTX *ctx, unsigned char *d, long len);
  210. =item int B<SSL_CTX_use_PrivateKey_file>(SSL_CTX *ctx, char *file, int type);
  211. =item int B<SSL_CTX_use_RSAPrivateKey>(SSL_CTX *ctx, RSA *rsa);
  212. =item int B<SSL_CTX_use_RSAPrivateKey_ASN1>(SSL_CTX *ctx, unsigned char *d, long len);
  213. =item int B<SSL_CTX_use_RSAPrivateKey_file>(SSL_CTX *ctx, char *file, int type);
  214. =item int B<SSL_CTX_use_certificate>(SSL_CTX *ctx, X509 *x);
  215. =item int B<SSL_CTX_use_certificate_ASN1>(SSL_CTX *ctx, int len, unsigned char *d);
  216. =item int B<SSL_CTX_use_certificate_file>(SSL_CTX *ctx, char *file, int type);
  217. =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));
  218. =item int B<SSL_CTX_use_psk_identity_hint>(SSL_CTX *ctx, const char *hint);
  219. =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));
  220. =back
  221. =head2 DEALING WITH SESSIONS
  222. Here we document the various API functions which deal with the SSL/TLS
  223. sessions defined in the B<SSL_SESSION> structures.
  224. =over 4
  225. =item int B<SSL_SESSION_cmp>(const SSL_SESSION *a, const SSL_SESSION *b);
  226. =item void B<SSL_SESSION_free>(SSL_SESSION *ss);
  227. =item char *B<SSL_SESSION_get_app_data>(SSL_SESSION *s);
  228. =item char *B<SSL_SESSION_get_ex_data>(const SSL_SESSION *s, int idx);
  229. =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))
  230. =item long B<SSL_SESSION_get_time>(const SSL_SESSION *s);
  231. =item long B<SSL_SESSION_get_timeout>(const SSL_SESSION *s);
  232. =item unsigned long B<SSL_SESSION_hash>(const SSL_SESSION *a);
  233. =item SSL_SESSION *B<SSL_SESSION_new>(void);
  234. =item int B<SSL_SESSION_print>(BIO *bp, const SSL_SESSION *x);
  235. =item int B<SSL_SESSION_print_fp>(FILE *fp, const SSL_SESSION *x);
  236. =item void B<SSL_SESSION_set_app_data>(SSL_SESSION *s, char *a);
  237. =item int B<SSL_SESSION_set_ex_data>(SSL_SESSION *s, int idx, char *arg);
  238. =item long B<SSL_SESSION_set_time>(SSL_SESSION *s, long t);
  239. =item long B<SSL_SESSION_set_timeout>(SSL_SESSION *s, long t);
  240. =back
  241. =head2 DEALING WITH CONNECTIONS
  242. Here we document the various API functions which deal with the SSL/TLS
  243. connection defined in the B<SSL> structure.
  244. =over 4
  245. =item int B<SSL_accept>(SSL *ssl);
  246. =item int B<SSL_add_dir_cert_subjects_to_stack>(STACK *stack, const char *dir);
  247. =item int B<SSL_add_file_cert_subjects_to_stack>(STACK *stack, const char *file);
  248. =item int B<SSL_add_client_CA>(SSL *ssl, X509 *x);
  249. =item char *B<SSL_alert_desc_string>(int value);
  250. =item char *B<SSL_alert_desc_string_long>(int value);
  251. =item char *B<SSL_alert_type_string>(int value);
  252. =item char *B<SSL_alert_type_string_long>(int value);
  253. =item int B<SSL_check_private_key>(const SSL *ssl);
  254. =item void B<SSL_clear>(SSL *ssl);
  255. =item long B<SSL_clear_num_renegotiations>(SSL *ssl);
  256. =item int B<SSL_connect>(SSL *ssl);
  257. =item void B<SSL_copy_session_id>(SSL *t, const SSL *f);
  258. =item long B<SSL_ctrl>(SSL *ssl, int cmd, long larg, char *parg);
  259. =item int B<SSL_do_handshake>(SSL *ssl);
  260. =item SSL *B<SSL_dup>(SSL *ssl);
  261. =item STACK *B<SSL_dup_CA_list>(STACK *sk);
  262. =item void B<SSL_free>(SSL *ssl);
  263. =item SSL_CTX *B<SSL_get_SSL_CTX>(const SSL *ssl);
  264. =item char *B<SSL_get_app_data>(SSL *ssl);
  265. =item X509 *B<SSL_get_certificate>(const SSL *ssl);
  266. =item const char *B<SSL_get_cipher>(const SSL *ssl);
  267. =item int B<SSL_get_cipher_bits>(const SSL *ssl, int *alg_bits);
  268. =item char *B<SSL_get_cipher_list>(const SSL *ssl, int n);
  269. =item char *B<SSL_get_cipher_name>(const SSL *ssl);
  270. =item char *B<SSL_get_cipher_version>(const SSL *ssl);
  271. =item STACK *B<SSL_get_ciphers>(const SSL *ssl);
  272. =item STACK *B<SSL_get_client_CA_list>(const SSL *ssl);
  273. =item SSL_CIPHER *B<SSL_get_current_cipher>(SSL *ssl);
  274. =item long B<SSL_get_default_timeout>(const SSL *ssl);
  275. =item int B<SSL_get_error>(const SSL *ssl, int i);
  276. =item char *B<SSL_get_ex_data>(const SSL *ssl, int idx);
  277. =item int B<SSL_get_ex_data_X509_STORE_CTX_idx>(void);
  278. =item int B<SSL_get_ex_new_index>(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))
  279. =item int B<SSL_get_fd>(const SSL *ssl);
  280. =item void (*B<SSL_get_info_callback>(const SSL *ssl);)()
  281. =item STACK *B<SSL_get_peer_cert_chain>(const SSL *ssl);
  282. =item X509 *B<SSL_get_peer_certificate>(const SSL *ssl);
  283. =item EVP_PKEY *B<SSL_get_privatekey>(SSL *ssl);
  284. =item int B<SSL_get_quiet_shutdown>(const SSL *ssl);
  285. =item BIO *B<SSL_get_rbio>(const SSL *ssl);
  286. =item int B<SSL_get_read_ahead>(const SSL *ssl);
  287. =item SSL_SESSION *B<SSL_get_session>(const SSL *ssl);
  288. =item char *B<SSL_get_shared_ciphers>(const SSL *ssl, char *buf, int len);
  289. =item int B<SSL_get_shutdown>(const SSL *ssl);
  290. =item const SSL_METHOD *B<SSL_get_ssl_method>(SSL *ssl);
  291. =item int B<SSL_get_state>(const SSL *ssl);
  292. =item long B<SSL_get_time>(const SSL *ssl);
  293. =item long B<SSL_get_timeout>(const SSL *ssl);
  294. =item int (*B<SSL_get_verify_callback>(const SSL *ssl))(int,X509_STORE_CTX *)
  295. =item int B<SSL_get_verify_mode>(const SSL *ssl);
  296. =item long B<SSL_get_verify_result>(const SSL *ssl);
  297. =item char *B<SSL_get_version>(const SSL *ssl);
  298. =item BIO *B<SSL_get_wbio>(const SSL *ssl);
  299. =item int B<SSL_in_accept_init>(SSL *ssl);
  300. =item int B<SSL_in_before>(SSL *ssl);
  301. =item int B<SSL_in_connect_init>(SSL *ssl);
  302. =item int B<SSL_in_init>(SSL *ssl);
  303. =item int B<SSL_is_init_finished>(SSL *ssl);
  304. =item STACK *B<SSL_load_client_CA_file>(char *file);
  305. =item void B<SSL_load_error_strings>(void);
  306. =item SSL *B<SSL_new>(SSL_CTX *ctx);
  307. =item long B<SSL_num_renegotiations>(SSL *ssl);
  308. =item int B<SSL_peek>(SSL *ssl, void *buf, int num);
  309. =item int B<SSL_pending>(const SSL *ssl);
  310. =item int B<SSL_read>(SSL *ssl, void *buf, int num);
  311. =item int B<SSL_renegotiate>(SSL *ssl);
  312. =item char *B<SSL_rstate_string>(SSL *ssl);
  313. =item char *B<SSL_rstate_string_long>(SSL *ssl);
  314. =item long B<SSL_session_reused>(SSL *ssl);
  315. =item void B<SSL_set_accept_state>(SSL *ssl);
  316. =item void B<SSL_set_app_data>(SSL *ssl, char *arg);
  317. =item void B<SSL_set_bio>(SSL *ssl, BIO *rbio, BIO *wbio);
  318. =item int B<SSL_set_cipher_list>(SSL *ssl, char *str);
  319. =item void B<SSL_set_client_CA_list>(SSL *ssl, STACK *list);
  320. =item void B<SSL_set_connect_state>(SSL *ssl);
  321. =item int B<SSL_set_ex_data>(SSL *ssl, int idx, char *arg);
  322. =item int B<SSL_set_fd>(SSL *ssl, int fd);
  323. =item void B<SSL_set_info_callback>(SSL *ssl, void (*cb);(void))
  324. =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));
  325. =item void B<SSL_set_msg_callback_arg>(SSL *ctx, void *arg);
  326. =item void B<SSL_set_options>(SSL *ssl, unsigned long op);
  327. =item void B<SSL_set_quiet_shutdown>(SSL *ssl, int mode);
  328. =item void B<SSL_set_read_ahead>(SSL *ssl, int yes);
  329. =item int B<SSL_set_rfd>(SSL *ssl, int fd);
  330. =item int B<SSL_set_session>(SSL *ssl, SSL_SESSION *session);
  331. =item void B<SSL_set_shutdown>(SSL *ssl, int mode);
  332. =item int B<SSL_set_ssl_method>(SSL *ssl, const SSL_METHOD *meth);
  333. =item void B<SSL_set_time>(SSL *ssl, long t);
  334. =item void B<SSL_set_timeout>(SSL *ssl, long t);
  335. =item void B<SSL_set_verify>(SSL *ssl, int mode, int (*callback);(void))
  336. =item void B<SSL_set_verify_result>(SSL *ssl, long arg);
  337. =item int B<SSL_set_wfd>(SSL *ssl, int fd);
  338. =item int B<SSL_shutdown>(SSL *ssl);
  339. =item int B<SSL_state>(const SSL *ssl);
  340. =item char *B<SSL_state_string>(const SSL *ssl);
  341. =item char *B<SSL_state_string_long>(const SSL *ssl);
  342. =item long B<SSL_total_renegotiations>(SSL *ssl);
  343. =item int B<SSL_use_PrivateKey>(SSL *ssl, EVP_PKEY *pkey);
  344. =item int B<SSL_use_PrivateKey_ASN1>(int type, SSL *ssl, unsigned char *d, long len);
  345. =item int B<SSL_use_PrivateKey_file>(SSL *ssl, char *file, int type);
  346. =item int B<SSL_use_RSAPrivateKey>(SSL *ssl, RSA *rsa);
  347. =item int B<SSL_use_RSAPrivateKey_ASN1>(SSL *ssl, unsigned char *d, long len);
  348. =item int B<SSL_use_RSAPrivateKey_file>(SSL *ssl, char *file, int type);
  349. =item int B<SSL_use_certificate>(SSL *ssl, X509 *x);
  350. =item int B<SSL_use_certificate_ASN1>(SSL *ssl, int len, unsigned char *d);
  351. =item int B<SSL_use_certificate_file>(SSL *ssl, char *file, int type);
  352. =item int B<SSL_version>(const SSL *ssl);
  353. =item int B<SSL_want>(const SSL *ssl);
  354. =item int B<SSL_want_nothing>(const SSL *ssl);
  355. =item int B<SSL_want_read>(const SSL *ssl);
  356. =item int B<SSL_want_write>(const SSL *ssl);
  357. =item int B<SSL_want_x509_lookup>(const SSL *ssl);
  358. =item int B<SSL_write>(SSL *ssl, const void *buf, int num);
  359. =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));
  360. =item int B<SSL_use_psk_identity_hint>(SSL *ssl, const char *hint);
  361. =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));
  362. =item const char *B<SSL_get_psk_identity_hint>(SSL *ssl);
  363. =item const char *B<SSL_get_psk_identity>(SSL *ssl);
  364. =back
  365. =head1 SEE ALSO
  366. L<openssl(1)|openssl(1)>, L<crypto(3)|crypto(3)>,
  367. L<SSL_accept(3)|SSL_accept(3)>, L<SSL_clear(3)|SSL_clear(3)>,
  368. L<SSL_connect(3)|SSL_connect(3)>,
  369. L<SSL_CIPHER_get_name(3)|SSL_CIPHER_get_name(3)>,
  370. L<SSL_COMP_add_compression_method(3)|SSL_COMP_add_compression_method(3)>,
  371. L<SSL_CTX_add_extra_chain_cert(3)|SSL_CTX_add_extra_chain_cert(3)>,
  372. L<SSL_CTX_add_session(3)|SSL_CTX_add_session(3)>,
  373. L<SSL_CTX_ctrl(3)|SSL_CTX_ctrl(3)>,
  374. L<SSL_CTX_flush_sessions(3)|SSL_CTX_flush_sessions(3)>,
  375. L<SSL_CTX_get_ex_new_index(3)|SSL_CTX_get_ex_new_index(3)>,
  376. L<SSL_CTX_get_verify_mode(3)|SSL_CTX_get_verify_mode(3)>,
  377. L<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)>
  378. L<SSL_CTX_new(3)|SSL_CTX_new(3)>,
  379. L<SSL_CTX_sess_number(3)|SSL_CTX_sess_number(3)>,
  380. L<SSL_CTX_sess_set_cache_size(3)|SSL_CTX_sess_set_cache_size(3)>,
  381. L<SSL_CTX_sess_set_get_cb(3)|SSL_CTX_sess_set_get_cb(3)>,
  382. L<SSL_CTX_sessions(3)|SSL_CTX_sessions(3)>,
  383. L<SSL_CTX_set_cert_store(3)|SSL_CTX_set_cert_store(3)>,
  384. L<SSL_CTX_set_cert_verify_callback(3)|SSL_CTX_set_cert_verify_callback(3)>,
  385. L<SSL_CTX_set_cipher_list(3)|SSL_CTX_set_cipher_list(3)>,
  386. L<SSL_CTX_set_client_CA_list(3)|SSL_CTX_set_client_CA_list(3)>,
  387. L<SSL_CTX_set_client_cert_cb(3)|SSL_CTX_set_client_cert_cb(3)>,
  388. L<SSL_CTX_set_default_passwd_cb(3)|SSL_CTX_set_default_passwd_cb(3)>,
  389. L<SSL_CTX_set_generate_session_id(3)|SSL_CTX_set_generate_session_id(3)>,
  390. L<SSL_CTX_set_info_callback(3)|SSL_CTX_set_info_callback(3)>,
  391. L<SSL_CTX_set_max_cert_list(3)|SSL_CTX_set_max_cert_list(3)>,
  392. L<SSL_CTX_set_mode(3)|SSL_CTX_set_mode(3)>,
  393. L<SSL_CTX_set_msg_callback(3)|SSL_CTX_set_msg_callback(3)>,
  394. L<SSL_CTX_set_options(3)|SSL_CTX_set_options(3)>,
  395. L<SSL_CTX_set_quiet_shutdown(3)|SSL_CTX_set_quiet_shutdown(3)>,
  396. L<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>,
  397. L<SSL_CTX_set_session_id_context(3)|SSL_CTX_set_session_id_context(3)>,
  398. L<SSL_CTX_set_ssl_version(3)|SSL_CTX_set_ssl_version(3)>,
  399. L<SSL_CTX_set_timeout(3)|SSL_CTX_set_timeout(3)>,
  400. L<SSL_CTX_set_tmp_rsa_callback(3)|SSL_CTX_set_tmp_rsa_callback(3)>,
  401. L<SSL_CTX_set_tmp_dh_callback(3)|SSL_CTX_set_tmp_dh_callback(3)>,
  402. L<SSL_CTX_set_verify(3)|SSL_CTX_set_verify(3)>,
  403. L<SSL_CTX_use_certificate(3)|SSL_CTX_use_certificate(3)>,
  404. L<SSL_alert_type_string(3)|SSL_alert_type_string(3)>,
  405. L<SSL_do_handshake(3)|SSL_do_handshake(3)>,
  406. L<SSL_get_SSL_CTX(3)|SSL_get_SSL_CTX(3)>,
  407. L<SSL_get_ciphers(3)|SSL_get_ciphers(3)>,
  408. L<SSL_get_client_CA_list(3)|SSL_get_client_CA_list(3)>,
  409. L<SSL_get_default_timeout(3)|SSL_get_default_timeout(3)>,
  410. L<SSL_get_error(3)|SSL_get_error(3)>,
  411. L<SSL_get_ex_data_X509_STORE_CTX_idx(3)|SSL_get_ex_data_X509_STORE_CTX_idx(3)>,
  412. L<SSL_get_ex_new_index(3)|SSL_get_ex_new_index(3)>,
  413. L<SSL_get_fd(3)|SSL_get_fd(3)>,
  414. L<SSL_get_peer_cert_chain(3)|SSL_get_peer_cert_chain(3)>,
  415. L<SSL_get_rbio(3)|SSL_get_rbio(3)>,
  416. L<SSL_get_session(3)|SSL_get_session(3)>,
  417. L<SSL_get_verify_result(3)|SSL_get_verify_result(3)>,
  418. L<SSL_get_version(3)|SSL_get_version(3)>,
  419. L<SSL_library_init(3)|SSL_library_init(3)>,
  420. L<SSL_load_client_CA_file(3)|SSL_load_client_CA_file(3)>,
  421. L<SSL_new(3)|SSL_new(3)>,
  422. L<SSL_pending(3)|SSL_pending(3)>,
  423. L<SSL_read(3)|SSL_read(3)>,
  424. L<SSL_rstate_string(3)|SSL_rstate_string(3)>,
  425. L<SSL_session_reused(3)|SSL_session_reused(3)>,
  426. L<SSL_set_bio(3)|SSL_set_bio(3)>,
  427. L<SSL_set_connect_state(3)|SSL_set_connect_state(3)>,
  428. L<SSL_set_fd(3)|SSL_set_fd(3)>,
  429. L<SSL_set_session(3)|SSL_set_session(3)>,
  430. L<SSL_set_shutdown(3)|SSL_set_shutdown(3)>,
  431. L<SSL_shutdown(3)|SSL_shutdown(3)>,
  432. L<SSL_state_string(3)|SSL_state_string(3)>,
  433. L<SSL_want(3)|SSL_want(3)>,
  434. L<SSL_write(3)|SSL_write(3)>,
  435. L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>,
  436. L<SSL_SESSION_get_ex_new_index(3)|SSL_SESSION_get_ex_new_index(3)>,
  437. L<SSL_SESSION_get_time(3)|SSL_SESSION_get_time(3)>,
  438. L<d2i_SSL_SESSION(3)|d2i_SSL_SESSION(3)>,
  439. L<SSL_CTX_set_psk_client_callback(3)|SSL_CTX_set_psk_client_callback(3)>,
  440. L<SSL_CTX_use_psk_identity_hint(3)|SSL_CTX_use_psk_identity_hint(3)>,
  441. L<SSL_get_psk_identity(3)|SSL_get_psk_identity(3)>
  442. =head1 HISTORY
  443. The L<ssl(3)|ssl(3)> document appeared in OpenSSL 0.9.2
  444. =cut