NAME
SSLCTXnew - create a new SSLCTX object as framework for TLS/SSL
enabled functionsSYNOPSIS
#include
SSLCTX *SSLCTXnew(SSLMETHOD *method);DESCRIPTION
SSLCTXnew() creates a new SSSSLLCCTTXX object as framework to establish TLS/SSL enabled connections. NNOOTTEESS The SSLCTX object uses mmeetthhoodd as connection method. The methods exist in a generic type (for client and server use), a server only type, and a client only type. mmeetthhoodd can be of the following types: SSLv2method(void), SSLv2servermethod(void), SSLv2clientmethod(void) A TLS/SSL connection established with these methods will only understand the SSLv2 protocol. A client will send out SSLv2 client hello messages and will also indicate that it only understand SSLv2. A server will only understand SSLv2 client hello messages. SSLv3method(void), SSLv3servermethod(void), SSLv3clientmethod(void) A TLS/SSL connection established with these methods will only understand the SSLv3 protocol. A client will send out SSLv3 client hello messages and will indicate that it only understands SSLv3. A server will only understand SSLv3 client hello messages. This especially means, that it will not understand SSLv2 client hello messages which are widely used for compatibility reasons, see SSLv23*method(). TLSv1method(void), TLSv1servermethod(void), TLSv1clientmethod(void) A TLS/SSL connection established with these methods will only understand the TLSv1 protocol. A client will send out TLSv1 client hello messages and will indicate that it only understands TLSv1. A server will only understand TLSv1 client hello messages. This especially means, that it will not understand SSLv2 client hello messages which are widely used for compatibility reasons, see SSLv23*method(). It will also not understand SSLv3 client hello messages. SSLv23method(void), SSLv23servermethod(void), SSLv23clientmethod(void) A TLS/SSL connection established with these methods will understand the SSLv2, SSLv3, and TLSv1 protocol. A client will send out SSLv2 client hello messages and will indicate that it also understands SSLv3 and TLSv1. A server will understand SSLv2, SSLv3, and TLSv1 client hello messages. This is the best choice when compatibility is a concern. The list of protocols available can later be limited using the SSLOPNOSSLv2, SSLOPNOSSLv3, SSLOPNOTLSv1 options of the SSSSLLCCTTXXsseettooppttiioonnss(()) or SSSSLLsseettooppttiioonnss(()) functions. Using these options it is possible to choose e.g. SSLv23servermethod() and be able to negotiate with all possible clients, but to only allow newer protocols like SSLv3 or TLSv1. SSLCTXnew() initializes the list of ciphers, the session cache setting, the callbacks, the keys and certificates, and the options to its default values.RETURN VALUES
The following return values can occur: NULL The creation of a new SSLCTX object failed. Check the error stack to find out the reason. Pointer to an SSLCTX object The return value points to an allocated SSLCTX object.SEE ALSO
SSLCTXfree(3), SSLaccept(3), ssl(3), SSLsetconnectstate(3)0.9.7l 2001-07-25 SSLCTXnew(3)