X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=doc%2Fssl%2Fssl.pod;h=6d78437159936ac508b7c85271f0a67987a4a172;hp=421d50066da96f532c33c1a28831984b5a98dab5;hb=e040a42e44b40f09ce485f66c9198456a3f8a457;hpb=87d9cafa332bd006086b56dc645c03fe7cfed654 diff --git a/doc/ssl/ssl.pod b/doc/ssl/ssl.pod index 421d50066d..6d78437159 100644 --- a/doc/ssl/ssl.pod +++ b/doc/ssl/ssl.pod @@ -1,21 +1,21 @@ - =pod +=for comment openssl_manual_section:7 + =head1 NAME SSL - OpenSSL SSL/TLS library =head1 SYNOPSIS +See the individual manual pages for details. + =head1 DESCRIPTION The OpenSSL B library implements the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols. It provides a rich API which is documented here. -At first the library must be initialized; see -L. - Then an B object is created as a framework to establish TLS/SSL enabled connections (see L). Various options regarding certificates, algorithms etc. can be set @@ -79,7 +79,7 @@ links to mostly all other structures. =head1 HEADER FILES Currently the OpenSSL B library provides the following C header files -containing the prototypes for the data structures and and functions: +containing the prototypes for the data structures and functions: =over 4 @@ -114,40 +114,78 @@ it's already included by ssl.h>. Currently the OpenSSL B library exports 214 API functions. They are documented in the following: -=head2 DEALING WITH PROTOCOL METHODS +=head2 Dealing with Protocol Methods Here we document the various API functions which deal with the SSL/TLS protocol methods defined in B structures. =over 4 -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); -Constructor for the SSLv3 SSL_METHOD structure for a dedicated client. +Constructor for the I SSL_METHOD structure for clients, +servers or both. +See L for details. -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); -Constructor for the SSLv3 SSL_METHOD structure for a dedicated server. +Constructor for the I SSL_METHOD structure for clients. -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); + +Constructor for the I SSL_METHOD structure for servers. + +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1.2 SSL_METHOD structure for clients, servers or both. + +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1.2 SSL_METHOD structure for clients. + +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1.2 SSL_METHOD structure for servers. -Constructor for the SSLv3 SSL_METHOD structure for combined client and server. +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1.1 SSL_METHOD structure for clients, servers or both. + +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1.1 SSL_METHOD structure for clients. + +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1.1 SSL_METHOD structure for servers. + +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1 SSL_METHOD structure for clients, servers or both. =item const SSL_METHOD *B(void); -Constructor for the TLSv1 SSL_METHOD structure for a dedicated client. +Constructor for the TLSv1 SSL_METHOD structure for clients. =item const SSL_METHOD *B(void); -Constructor for the TLSv1 SSL_METHOD structure for a dedicated server. +Constructor for the TLSv1 SSL_METHOD structure for servers. -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); + +Constructor for the SSLv3 SSL_METHOD structure for clients, servers or both. + +=item const SSL_METHOD *B(void); + +Constructor for the SSLv3 SSL_METHOD structure for clients. -Constructor for the TLSv1 SSL_METHOD structure for combined client and server. +=item const SSL_METHOD *B(void); + +Constructor for the SSLv3 SSL_METHOD structure for servers. =back -=head2 DEALING WITH CIPHERS +=head2 Dealing with Ciphers Here we document the various API functions which deal with the SSL/TLS ciphers defined in B structures. @@ -171,7 +209,7 @@ Return the internal name of I as a string. These are the various strings defined by the I and I definitions in the header files. -=item char *B(SSL_CIPHER *cipher); +=item const char *B(SSL_CIPHER *cipher); Returns a string like "C" or "C" which indicates the SSL/TLS protocol version to which I belongs (i.e. where it was defined @@ -179,7 +217,7 @@ in the specification the first time). =back -=head2 DEALING WITH PROTOCOL CONTEXTS +=head2 Dealing with Protocol Contexts Here we document the various API functions which deal with the SSL/TLS protocol context defined in the B structure. @@ -204,6 +242,8 @@ protocol context defined in the B structure. =item X509_STORE *B(SSL_CTX *ctx); +=item STACK *B(const SSL_CTX *ctx); + =item STACK *B(const SSL_CTX *ctx); =item int (*B(SSL_CTX *ctx))(SSL *ssl, X509 **x509, EVP_PKEY **pkey); @@ -228,12 +268,12 @@ protocol context defined in the B structure. =item int B(SSL_CTX *ctx); -=item int B(SSL_CTX *ctx, char *CAfile, char *CApath); - -=item long B(SSL_CTX *ctx); +=item int B(SSL_CTX *ctx, const char *CAfile, const char *CApath); =item SSL_CTX *B(const SSL_METHOD *meth); +=item int SSL_CTX_up_ref(SSL_CTX *ctx); + =item int B(SSL_CTX *ctx, SSL_SESSION *c); =item int B(SSL_CTX *ctx); @@ -266,7 +306,7 @@ protocol context defined in the B structure. =item int B(SSL_CTX *ctx); -=item void B(SSL_CTX *ctx,t); +=item void B(SSL_CTX *ctx, t); =item void B(SSL_CTX *ctx, SSL_SESSION *(*cb)(SSL *ssl, unsigned char *data, int len, int *copy)); @@ -278,7 +318,7 @@ protocol context defined in the B structure. =item LHASH *B(SSL_CTX *ctx); -=item void B(SSL_CTX *ctx, void *arg); +=item int B(SSL_CTX *ctx, void *arg); =item void B(SSL_CTX *ctx, X509_STORE *cs); @@ -301,11 +341,11 @@ directory path and one default file path. Both are set via this call. =item int B(SSL_CTX *ctx) -Use the default directory path to locate trusted CA certficates. +Use the default directory path to locate trusted CA certificates. =item int B(SSL_CTX *ctx) -Use the file path to locate trusted CA certficates. +Use the file path to locate trusted CA certificates. =item int B(SSL_CTX *s, int idx, char *arg); @@ -315,7 +355,11 @@ Use the file path to locate trusted CA certficates. =item void B(SSL_CTX *ctx, void *arg); -=item void B(SSL_CTX *ctx, unsigned long op); +=item unsigned long B(SSL_CTX *ctx, unsigned long op); + +=item unsigned long B(SSL_CTX *ctx); + +=item unsigned long B(SSL_CTX *ctx, unsigned long op); =item void B(SSL_CTX *ctx, int mode); @@ -331,44 +375,25 @@ Use the file path to locate trusted CA certficates. =item long B(SSL_CTX *ctx, DH *(*cb)(void)); -=item long B(SSL_CTX *ctx, RSA *rsa); - -=item SSL_CTX_set_tmp_rsa_callback - -C(SSL_CTX *B, RSA *(*B)(SSL *B, int B, int B));> - -Sets the callback which will be called when a temporary private key is -required. The B> flag will be set if the reason for needing -a temp key is that an export ciphersuite is in use, in which case, -B> will contain the required keylength in bits. Generate a key of -appropriate size (using ???) and return it. - -=item SSL_set_tmp_rsa_callback - -long B(SSL *ssl, RSA *(*cb)(SSL *ssl, int export, int keylength)); - -The same as B, except it operates on an SSL -session instead of a context. - =item void B(SSL_CTX *ctx, int mode, int (*cb);(void)) =item int B(SSL_CTX *ctx, EVP_PKEY *pkey); =item int B(int type, SSL_CTX *ctx, unsigned char *d, long len); -=item int B(SSL_CTX *ctx, char *file, int type); +=item int B(SSL_CTX *ctx, const char *file, int type); =item int B(SSL_CTX *ctx, RSA *rsa); =item int B(SSL_CTX *ctx, unsigned char *d, long len); -=item int B(SSL_CTX *ctx, char *file, int type); +=item int B(SSL_CTX *ctx, const char *file, int type); =item int B(SSL_CTX *ctx, X509 *x); =item int B(SSL_CTX *ctx, int len, unsigned char *d); -=item int B(SSL_CTX *ctx, char *file, int type); +=item int B(SSL_CTX *ctx, const char *file, int type); =item X509 *B(const SSL_CTX *ctx); @@ -381,11 +406,9 @@ session instead of a context. =item void B(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)); - - =back -=head2 DEALING WITH SESSIONS +=head2 Dealing with Sessions Here we document the various API functions which deal with the SSL/TLS sessions defined in the B structures. @@ -414,7 +437,7 @@ sessions defined in the B structures. =item int B(FILE *fp, const SSL_SESSION *x); -=item void B(SSL_SESSION *s, char *a); +=item int B(SSL_SESSION *s, char *a); =item int B(SSL_SESSION *s, int idx, char *arg); @@ -424,7 +447,7 @@ sessions defined in the B structures. =back -=head2 DEALING WITH CONNECTIONS +=head2 Dealing with Connections Here we document the various API functions which deal with the SSL/TLS connection defined in the B structure. @@ -466,6 +489,25 @@ success or 0 on failure. =item SSL *B(SSL *ssl); +SSL_dup() allows applications to configure an SSL handle for use +in multiple SSL connections, and then duplicate it prior to initiating +each connection with the duplicated handle. +Use of SSL_dup() avoids the need to repeat the configuration of the +handles for each connection. +This is used internally by L to construct +per-connection SSL handles after L. + +For SSL_dup() to work, the connection MUST be in its initial state +and MUST NOT have not yet have started the SSL handshake. +For connections that are not in their initial state SSL_dup() just +increments an internal reference count and returns the I +handle. +It may be possible to use L to recycle an SSL handle +that is not in its initial state for re-use, but this is best +avoided. +Instead, save and restore the session, if desired, and construct a +fresh handle for each connection. + =item STACK *B(STACK *sk); =item void B(SSL *ssl); @@ -478,6 +520,8 @@ success or 0 on failure. =item const char *B(const SSL *ssl); +=item int B(const SSL *ssl); + =item int B(const SSL *ssl, int *alg_bits); =item char *B(const SSL *ssl, int n); @@ -532,7 +576,7 @@ success or 0 on failure. =item long B(const SSL *ssl); -=item int (*B(const SSL *ssl))(int,X509_STORE_CTX *) +=item int (*B(const SSL *ssl))(int, X509_STORE_CTX *) =item int B(const SSL *ssl); @@ -552,12 +596,12 @@ success or 0 on failure. =item int B(SSL *ssl); -=item STACK *B(char *file); - -=item void B(void); +=item STACK *B(const char *file); =item SSL *B(SSL_CTX *ctx); +=item int SSL_up_ref(SSL *s); + =item long B(SSL *ssl); =item int B(SSL *ssl, void *buf, int num); @@ -596,7 +640,11 @@ success or 0 on failure. =item void B(SSL *ctx, void *arg); -=item void B(SSL *ssl, unsigned long op); +=item unsigned long B(SSL *ssl, unsigned long op); + +=item unsigned long B(SSL *ssl); + +=item unsigned long B(SSL *ssl, unsigned long op); =item void B(SSL *ssl, int mode); @@ -636,19 +684,19 @@ Returns the current handshake state. =item int B(int type, SSL *ssl, unsigned char *d, long len); -=item int B(SSL *ssl, char *file, int type); +=item int B(SSL *ssl, const char *file, int type); =item int B(SSL *ssl, RSA *rsa); =item int B(SSL *ssl, unsigned char *d, long len); -=item int B(SSL *ssl, char *file, int type); +=item int B(SSL *ssl, const char *file, int type); =item int B(SSL *ssl, X509 *x); =item int B(SSL *ssl, int len, unsigned char *d); -=item int B(SSL *ssl, char *file, int type); +=item int B(SSL *ssl, const char *file, int type); =item int B(const SSL *ssl); @@ -676,9 +724,14 @@ Returns the current handshake state. =back +=head1 RETURN VALUES + +See the individual manual pages for details. + =head1 SEE ALSO L, L, +L, L, L, L, L, @@ -687,7 +740,6 @@ L, L, L, L, -L, L, L L, @@ -713,7 +765,6 @@ L, L, L, L, -L, L, L, L, @@ -725,14 +776,12 @@ L, L, L, L, -L, L, L, L, L, L, L, -L, L, L, L, @@ -749,13 +798,12 @@ L, L, L, L, -L, L, L, L, L, L, -L +L =head1 HISTORY @@ -765,5 +813,13 @@ in OpenSSL 1.1.0. The return type of B was changed from void to int in OpenSSL 1.1.0. -=cut +=head1 COPYRIGHT +Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut