4371N/A# This was developed in house. Not applicable to the upstream.
4371N/A /* This sets the 'default' SSL version that SSL_new() will create */
4371N/A int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth);
4371N/A+# define __has_attribute(x) 0
4371N/A+/* Mark SSLv2_* functions deprecated */
4371N/A+#if __has_attribute(deprecated) \
4371N/A+ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)) \
4371N/A+ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5130))
4371N/A+# define DEPRECATED __attribute__((deprecated))
5912N/A # ifndef OPENSSL_NO_SSL2_METHOD
5912N/A-const SSL_METHOD *SSLv2_method(void); /* SSLv2 */
5912N/A-const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
5912N/A-const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
4371N/A+DEPRECATED const SSL_METHOD *SSLv2_method(void); /* SSLv2 */
4371N/A+DEPRECATED const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
4371N/A+DEPRECATED const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
4371N/A # ifndef OPENSSL_NO_SSL3_METHOD
4907N/A IMPLEMENT_ssl3_meth_func(SSLv3_method,
4907N/A ssl3_accept, ssl3_connect, ssl3_get_method)
4907N/A+#else /* !OPENSSL_NO_SSL3_METHOD */
4907N/A IMPLEMENT_ssl3_meth_func(SSLv3_client_method,
4907N/A ssl3_connect, ssl3_get_client_method)
4907N/A+#else /* !OPENSSL_NO_SSL3_METHOD */
4907N/A IMPLEMENT_ssl3_meth_func(SSLv3_server_method,
4907N/A ssl_undefined_function, ssl3_get_server_method)
4907N/A+#else /* !OPENSSL_NO_SSL3_METHOD */
4907N/A static int ssl_check_srp_ext_ClientHello(SSL *s, int *al)
4371N/A SSL_CIPHER_get_version() returns string which indicates the
SSL/TLS protocol
4371N/A version that first defined the cipher.
4371N/A In some cases it should possibly return "TLSv1.2" but does not;
4371N/A use SSL_CIPHER_description() instead.
4371N/A If B<cipher> is NULL, "(NONE)" is returned.
4371N/A-Protocol version: B<SSLv2>, B<SSLv3>, B<TLSv1.2>. The TLSv1.0 ciphers are
4371N/A+Protocol version: B<SSLv3>, B<TLSv1.2>. The TLSv1.0 ciphers are
4371N/A flagged with SSLv3. No new ciphers were added by TLSv1.1.
5537N/A TLSv1_1_method, TLSv1_1_server_method, TLSv1_1_client_method,
5537N/A TLSv1_method, TLSv1_server_method, TLSv1_client_method,
5537N/A SSLv3_method, SSLv3_server_method, SSLv3_client_method,
5537N/A-SSLv2_method, SSLv2_server_method, SSLv2_client_method,
5537N/A DTLS_method, DTLS_server_method, DTLS_client_method,
5537N/A DTLSv1_2_method, DTLSv1_2_server_method, DTLSv1_2_client_method,
5537N/A DTLSv1_method, DTLSv1_server_method, DTLSv1_client_method -
5537N/A These are the general-purpose I<version-flexible>
SSL/TLS methods.
5537N/A The actual protocol version used will be negotiated to the highest version
5537N/A mutually supported by the client and the server.
5537N/A-The supported protocols are SSLv2, SSLv3, TLSv1, TLSv1.1 and TLSv1.2.
5537N/A+The supported protocols are TLSv1, TLSv1.1 and TLSv1.2.
5537N/A Most applications should use these method, and avoid the version specific
5537N/A =item SSLv3_method(), SSLv3_server_method(), SSLv3_client_method()
4371N/A A
TLS/SSL connection established with these methods will only understand the
5537N/A-SSLv3 protocol. A client will send out SSLv3 client hello messages and will
5537N/A-indicate that it only understands SSLv3. A server will only understand SSLv3
5537N/A-client hello messages. The SSLv3 protocol is deprecated and should not be
4371N/A+SSLv3 protocol. However, SSLv3 is not supported by this relese of OpenSSL.
5537N/A =item SSLv2_method(), SSLv2_server_method(), SSLv2_client_method()
5537N/A-A
TLS/SSL connection established with these methods will only understand the
5537N/A-SSLv2 protocol. A client will send out SSLv2 client hello messages and will
5537N/A-also indicate that it only understand SSLv2. A server will only understand
5537N/A-SSLv2 client hello messages. The SSLv2 protocol offers little to no security
5537N/A-As of OpenSSL 1.0.2g, EXPORT ciphers and 56-bit DES are no longer available
5537N/A+These functions are deprecated.
5537N/A =item DTLS_method(), DTLS_server_method(), DTLS_client_method()
4371N/A keys), the "no shared cipher" (SSL_R_NO_SHARED_CIPHER) error is generated
4371N/A and the handshake will fail.
4371N/A-If the cipher list does not contain any SSLv2 cipher suites (this is the
4371N/A-default) then SSLv2 is effectively disabled and neither clients nor servers
4371N/A SSL_CTX_set_cipher_list() and SSL_set_cipher_list() return 1 if any cipher
4371N/A When a new session is established between client and server, the server
4371N/A generates a session id. The session id is an arbitrary sequence of bytes.
4371N/A-The length of the session id is 16 bytes for SSLv2 sessions and between
4371N/A-but must be unique for the server. Additionally, the session id is
4371N/A+The length of the session id is between 1 and 32 bytes for TLSv1. The session id is not
4371N/A+security critical but must be unique for the server. Additionally, the session id is
4371N/A transmitted in the clear when reusing the session so it must not contain
4371N/A the callback B<must never> increase B<id_len> or write to the location
4371N/A B<id> exceeding the given limit.
4371N/A-If a SSLv2 session id is generated and B<id_len> is reduced, it will be
4371N/A-restored after the callback has finished and the session id will be padded
4371N/A-with 0x00. It is not recommended to change the B<id_len> for SSLv2 sessions.
4371N/A-The callback can use the L<SSL_get_version(3)|SSL_get_version(3)> function
4371N/A-to check, whether the session is of type SSLv2.
4371N/A The location B<id> is filled with 0x00 before the callback is called, so the
4371N/A callback may only fill part of the possible length and leave B<id_len>
4371N/A untouched while maintaining reproducibility.
4371N/A Since the sessions must be distinguished, session ids must be unique.
4371N/A Without the callback a random number is used, so that the probability
4371N/A-of generating the same session id is extremely small (2^128 possible ids
4371N/A-uniqueness of the generated session id, the callback must call
4371N/A+of generating the same session id is extremely small (2^256 for TLSv1).
4371N/A+In order to assure the uniqueness of the generated session id, the callback must call
4371N/A SSL_has_matching_session_id() and generate another id if a conflict occurs.
4371N/A If an id conflict is not resolved, the handshake will fail.
4371N/A If the application codes
e.g. a unique host id, a unique process number, and
4371N/A the external cache is not tested with SSL_has_matching_session_id()
4371N/A and the same race condition applies.
4371N/A-When calling SSL_has_matching_session_id() for an SSLv2 session with
4371N/A-reduced B<id_len>, the match operation will be performed using the
4371N/A-fixed length required and with a 0x00 padded id.
4371N/A The callback must return 0 if it cannot generate a session id for whatever
4371N/A reason and return 1 on success.
4371N/A- version = SSL_get_version(ssl);
4371N/A- if (!strcmp(version, "SSLv2"))
4371N/A- /* we must not change id_len */;
4371N/A RAND_pseudo_bytes(id, *id_len);
4371N/A /* Prefix the session_id with the required prefix. NB: If our
4371N/A =item SSL_OP_MICROSOFT_SESS_ID_BUG
4371N/A-performed, the session-id passed back in the server-finished message
4371N/A-is different from the one decided upon.
4371N/A+As of OpenSSL 1.0.0 this option has no effect.
4371N/A =item SSL_OP_NETSCAPE_CHALLENGE_BUG
4371N/A-Netscape-Commerce/1.12, when talking SSLv2, accepts a 32 byte
4371N/A-challenge but then appears to only use 16 bytes when generating the
4371N/A-encryption keys. Using 16 bytes is ok but it should be ok to use 32.
4371N/A-According to the SSLv3 spec, one should use 32 bytes for the challenge
4371N/A-when operating in
SSLv2/v3 compatibility mode, but as mentioned above,
4371N/A-this breaks this server so 16 bytes is the way to go.
4371N/A+As of OpenSSL 1.0.0 this option has no effect.
4371N/A =item SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
4371N/A timeout for the protocol will be used.
4371N/A SSL_get_default_timeout() return this hardcoded value, which is 300 seconds
4371N/A-for all currently supported protocols (SSLv2, SSLv3, and TLSv1).
4371N/A+for all currently supported protocols.
4371N/A-The connection uses the SSLv2 protocol.
4371N/A-The connection uses the SSLv3 protocol.
4371N/A The connection uses the TLSv1.0 protocol.
4371N/A SSL_new() creates a new B<SSL> structure which is needed to hold the
4371N/A data for a
TLS/SSL connection. The new structure inherits the settings
4371N/A+of the underlying context B<ctx>: connection method,
4371N/A options, verification settings, timeout settings.
4371N/A It is therefore recommended, to check the return value of SSL_shutdown()
4371N/A and call SSL_shutdown() again, if the bidirectional shutdown is not yet
4371N/A-complete (return value of the first call is 0). As the shutdown is not
4371N/A-specially handled in the SSLv2 protocol, SSL_shutdown() will succeed on
4371N/A+complete (return value of the first call is 0).
4371N/A The behaviour of SSL_shutdown() additionally depends on the underlying BIO.
4371N/A-The OpenSSL B<ssl> library implements the Secure Sockets Layer (SSL
v2/v3) and
4371N/A-Transport Layer Security (TLS v1) protocols. It provides a rich API which is
4371N/A+The OpenSSL B<ssl> library implements the Transport Layer Security (TLS v1)
4371N/A+protocols. It provides a rich API which is documented here.
4371N/A At first the library must be initialized; see
4371N/A L<SSL_library_init(3)|SSL_library_init(3)>.
4371N/A =item B<SSL_METHOD> (SSL Method)
4371N/A That's a dispatch structure describing the internal B<ssl> library
4371N/A-methods/functions which implement the various protocol versions (SSLv1, SSLv2
4371N/A-and TLSv1). It's needed to create an B<SSL_CTX>.
4371N/A+It's needed to create an B<SSL_CTX>.
4371N/A =item B<SSL_CIPHER> (SSL Cipher)
4371N/A-That's the sub header file dealing with the combined use of the SSLv2 and
4371N/A+That's the sub header file dealing with the combined use of different
4371N/A I<Usually you don't have to include it explicitly because
5537N/A =item const SSL_METHOD *B<SSLv2_method>(void);
5537N/A Constructor for the SSLv2 SSL_METHOD structure for clients, servers
4371N/A =item const SSL_METHOD *B<SSLv2_client_method>(void);
5537N/A-Constructor for the SSLv2 SSL_METHOD structure for clients.
5537N/A+Constructor for the SSLv2 SSL_METHOD structure for clients. (deprecated)
4371N/A =item const SSL_METHOD *B<SSLv2_server_method>(void);
5537N/A-Constructor for the SSLv2 SSL_METHOD structure for servers.
5537N/A+Constructor for the SSLv2 SSL_METHOD structure for servers. (deprecated)
4371N/A =item const char *B<SSL_CIPHER_get_name>(SSL_CIPHER *cipher);
4371N/A Return the internal name of I<cipher> as a string. These are the various
4371N/A-strings defined by the I<SSL2_TXT_xxx>, I<SSL3_TXT_xxx> and I<TLS1_TXT_xxx>
4371N/A+strings defined by the I<SSL3_TXT_xxx> and I<TLS1_TXT_xxx>
4371N/A definitions in the header files.
4371N/A =item char *B<SSL_CIPHER_get_version>(SSL_CIPHER *cipher);
4371N/A in the specification the first time).
4371N/A-Verbose option. List ciphers with a complete description of
4371N/A-protocol version (SSLv2 or SSLv3; the latter includes TLS), key exchange,
4371N/A-authentication, encryption and mac algorithms used along with any key size
4371N/A-restrictions and whether the algorithm is classed as an "export" cipher.
4371N/A-Note that without the B<-v> option, ciphers may seem to appear twice
4371N/A-in a cipher list; this is when similar ciphers are available for
4371N/A+Verbose option. List ciphers with a complete description of protocol version,
4371N/A+key exchange, authentication, encryption and mac algorithms used along with any
4371N/A+key size restrictions and whether the algorithm is classed as an "export" cipher.
4371N/A Like B<-v>, but include cipher suite codes in output (hex format).
5537N/A-This lists ciphers compatible with any of SSLv3, TLSv1, TLSv1.1 or TLSv1.2.
5537N/A+This lists ciphers compatible with any of TLSv1, TLSv1.1 or TLSv1.2.
5537N/A-Only include SSLv2 ciphers.
5537N/A Print a brief usage message.
4371N/A TLS_PSK_WITH_AES_128_CBC_SHA PSK-AES128-CBC-SHA
4371N/A TLS_PSK_WITH_AES_256_CBC_SHA PSK-AES256-CBC-SHA
4371N/A-=head2 Deprecated SSL v2.0 cipher suites.
4371N/A- SSL_CK_RC4_128_WITH_MD5 RC4-MD5
5537N/A- SSL_CK_RC4_128_EXPORT40_WITH_MD5 Not implemented.
5537N/A- SSL_CK_RC2_128_CBC_WITH_MD5 RC2-CBC-MD5
5537N/A- SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 Not implemented.
4371N/A- SSL_CK_IDEA_128_CBC_WITH_MD5 IDEA-CBC-MD5
5537N/A- SSL_CK_DES_64_CBC_WITH_MD5 Not implemented.
4371N/A- SSL_CK_DES_192_EDE3_CBC_WITH_MD5 DES-CBC3-MD5
4820N/A Some compiled versions of OpenSSL may not include all the ciphers
4371N/A given as a hexadecimal number without leading 0x, for example -psk
5537N/A-=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>
4371N/A+=item B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>
5537N/A-These options require or disable the use of the specified SSL or TLS protocols.
5537N/A+These options require or disable the use of the specified TLS protocols.
5537N/A By default the initial handshake uses a I<version-flexible> method which will
5537N/A negotiate the highest mutually supported protocol version.
4371N/A supported cipher in the list sent by the client. See the B<ciphers>
4371N/A command for more information.
4371N/A-use the server's cipher preferences; only used for SSLV2.
4371N/A =item B<-starttls protocol>
4371N/A send the protocol-specific message(s) to switch to TLS for communication.
4371N/A then an HTTP command can be given such as "GET /" to retrieve a web page.
4371N/A If the handshake fails then there are several possible causes, if it is
4371N/A-nothing obvious like no client certificate then the B<-bugs>, B<-ssl2>,
4371N/A-B<-ssl3>, B<-tls1>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1> options can be tried
4371N/A+nothing obvious like no client certificate then the B<-bugs>, B<-tls1>, B<-tls1_1>,
4371N/A+B<-tls1_2>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2> options can be tried
4371N/A in case it is a buggy server. In particular you should play with these
4371N/A options B<before> submitting a bug report to an OpenSSL mailing list.
4371N/A If there are problems verifying a server certificate then the
4371N/A B<-showcerts> option can be used to show the whole chain.
4371N/A-Since the SSLv23 client hello cannot include compression methods or extensions
4371N/A-these will only be supported if its use is disabled, for example by using the
4371N/A The B<s_client> utility is a test tool and is designed to continue the
4371N/A handshake after any certificate verification errors. As a result it will
4371N/A accept any certificate chain (trusted or not) sent by the peer. None test
4371N/A given as a hexadecimal number without leading 0x, for example -psk
5537N/A-=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>
4371N/A+=item B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>
5537N/A-These options require or disable the use of the specified SSL or TLS protocols.
5537N/A+These options require or disable the use of the specified TLS protocols.
5537N/A By default the initial handshake uses a I<version-flexible> method which will
5537N/A negotiate the highest mutually supported protocol version.
4371N/A-these options disable the use of certain SSL or TLS protocols. By default
4371N/A-the initial handshake uses a method which should be compatible with all
4371N/A-servers and permit them to use SSL v3, SSL v2 or TLS as appropriate.
4371N/A-The timing program is not as rich in options to turn protocols on and off as
4371N/A-the L<s_client(1)|s_client(1)> program and may not connect to all servers.
4371N/A-Unfortunately there are a lot of ancient and broken servers in use which
4371N/A-cannot handle this technique and will fail to connect. Some servers only
4371N/A-work if TLS is turned off with the B<-ssl3> option; others
4371N/A-will only support SSL v2 and may need the B<-ssl2> option.
4371N/A there are several known bug in SSL and TLS implementations. Adding this
4371N/A If the handshake fails then there are several possible causes, if it is
4371N/A-nothing obvious like no client certificate then the B<-bugs>, B<-ssl2>,
4371N/A-B<-ssl3> options can be tried
4371N/A+nothing obvious like no client certificate then the B<-bugs> option can be tried
4371N/A in case it is a buggy server. In particular you should play with these
4371N/A options B<before> submitting a bug report to an OpenSSL mailing list.
4371N/A-this is the protocol in use TLSv1, SSLv3 or SSLv2.
4371N/A+this is the protocol in use.
4371N/A this is the SSL session master key.
4371N/A-the key argument, this is only used in SSL v2.
4371N/A this is the session start time represented as an integer in standard Unix format.