1SSL_CTX_new(3) OpenSSL SSL_CTX_new(3)
2
3
4
6 SSL_CTX_new - create a new SSL_CTX object as framework for TLS/SSL
7 enabled functions
8
10 #include <openssl/ssl.h>
11
12 SSL_CTX *SSL_CTX_new(const SSL_METHOD *method);
13
15 SSL_CTX_new() creates a new SSL_CTX object as framework to establish
16 TLS/SSL enabled connections.
17
19 The SSL_CTX object uses method as connection method. The methods exist
20 in a generic type (for client and server use), a server only type, and
21 a client only type. method can be of the following types:
22
23 SSLv2_method(void), SSLv2_server_method(void),
24 SSLv2_client_method(void)
25 A TLS/SSL connection established with these methods will only
26 understand the SSLv2 protocol. A client will send out SSLv2 client
27 hello messages and will also indicate that it only understand
28 SSLv2. A server will only understand SSLv2 client hello messages.
29
30 SSLv3_method(void), SSLv3_server_method(void),
31 SSLv3_client_method(void)
32 A TLS/SSL connection established with these methods will only
33 understand the SSLv3 protocol. A client will send out SSLv3 client
34 hello messages and will indicate that it only understands SSLv3. A
35 server will only understand SSLv3 client hello messages. This
36 especially means, that it will not understand SSLv2 client hello
37 messages which are widely used for compatibility reasons, see
38 SSLv23_*_method().
39
40 TLSv1_method(void), TLSv1_server_method(void),
41 TLSv1_client_method(void)
42 A TLS/SSL connection established with these methods will only
43 understand the TLSv1 protocol. A client will send out TLSv1 client
44 hello messages and will indicate that it only understands TLSv1. A
45 server will only understand TLSv1 client hello messages. This
46 especially means, that it will not understand SSLv2 client hello
47 messages which are widely used for compatibility reasons, see
48 SSLv23_*_method(). It will also not understand SSLv3 client hello
49 messages.
50
51 SSLv23_method(void), SSLv23_server_method(void),
52 SSLv23_client_method(void)
53 A TLS/SSL connection established with these methods will understand
54 the SSLv2, SSLv3, and TLSv1 protocol. A client will send out SSLv2
55 client hello messages and will indicate that it also understands
56 SSLv3 and TLSv1. A server will understand SSLv2, SSLv3, and TLSv1
57 client hello messages. This is the best choice when compatibility
58 is a concern.
59
60 The list of protocols available can later be limited using the
61 SSL_OP_NO_SSLv2, SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1 options of the
62 SSL_CTX_set_options() or SSL_set_options() functions. Using these
63 options it is possible to choose e.g. SSLv23_server_method() and be
64 able to negotiate with all possible clients, but to only allow newer
65 protocols like SSLv3 or TLSv1.
66
67 SSL_CTX_new() initializes the list of ciphers, the session cache
68 setting, the callbacks, the keys and certificates, and the options to
69 its default values.
70
72 The following return values can occur:
73
74 NULL
75 The creation of a new SSL_CTX object failed. Check the error stack
76 to find out the reason.
77
78 Pointer to an SSL_CTX object
79 The return value points to an allocated SSL_CTX object.
80
82 SSL_CTX_free(3), SSL_accept(3), ssl(3), SSL_set_connect_state(3)
83
84
85
861.0.0e 2005-08-14 SSL_CTX_new(3)