1SSL_CTX_new(3) OpenSSL SSL_CTX_new(3)
2
3
4
6 SSL_CTX_new, SSLv23_method, SSLv23_server_method, SSLv23_client_method,
7 TLSv1_2_method, TLSv1_2_server_method, TLSv1_2_client_method,
8 TLSv1_1_method, TLSv1_1_server_method, TLSv1_1_client_method,
9 TLSv1_method, TLSv1_server_method, TLSv1_client_method, SSLv3_method,
10 SSLv3_server_method, SSLv3_client_method, SSLv2_method,
11 SSLv2_server_method, SSLv2_client_method, DTLS_method,
12 DTLS_server_method, DTLS_client_method, DTLSv1_2_method,
13 DTLSv1_2_server_method, DTLSv1_2_client_method, DTLSv1_method,
14 DTLSv1_server_method, DTLSv1_client_method - create a new SSL_CTX
15 object as framework for TLS/SSL enabled functions
16
18 #include <openssl/ssl.h>
19
20 SSL_CTX *SSL_CTX_new(const SSL_METHOD *method);
21 const SSL_METHOD *SSLv23_method(void);
22 const SSL_METHOD *SSLv23_server_method(void);
23 const SSL_METHOD *SSLv23_client_method(void);
24 const SSL_METHOD *TLSv1_2_method(void);
25 const SSL_METHOD *TLSv1_2_server_method(void);
26 const SSL_METHOD *TLSv1_2_client_method(void);
27 const SSL_METHOD *TLSv1_1_method(void);
28 const SSL_METHOD *TLSv1_1_server_method(void);
29 const SSL_METHOD *TLSv1_1_client_method(void);
30 const SSL_METHOD *TLSv1_method(void);
31 const SSL_METHOD *TLSv1_server_method(void);
32 const SSL_METHOD *TLSv1_client_method(void);
33 #ifndef OPENSSL_NO_SSL3_METHOD
34 const SSL_METHOD *SSLv3_method(void);
35 const SSL_METHOD *SSLv3_server_method(void);
36 const SSL_METHOD *SSLv3_client_method(void);
37 #endif
38 #ifndef OPENSSL_NO_SSL2
39 const SSL_METHOD *SSLv2_method(void);
40 const SSL_METHOD *SSLv2_server_method(void);
41 const SSL_METHOD *SSLv2_client_method(void);
42 #endif
43
44 const SSL_METHOD *DTLS_method(void);
45 const SSL_METHOD *DTLS_server_method(void);
46 const SSL_METHOD *DTLS_client_method(void);
47 const SSL_METHOD *DTLSv1_2_method(void);
48 const SSL_METHOD *DTLSv1_2_server_method(void);
49 const SSL_METHOD *DTLSv1_2_client_method(void);
50 const SSL_METHOD *DTLSv1_method(void);
51 const SSL_METHOD *DTLSv1_server_method(void);
52 const SSL_METHOD *DTLSv1_client_method(void);
53
55 SSL_CTX_new() creates a new SSL_CTX object as framework to establish
56 TLS/SSL enabled connections.
57
59 The SSL_CTX object uses method as connection method. The methods exist
60 in a generic type (for client and server use), a server only type, and
61 a client only type. method can be of the following types:
62
63 SSLv23_method(), SSLv23_server_method(), SSLv23_client_method()
64 These are the general-purpose version-flexible SSL/TLS methods.
65 The actual protocol version used will be negotiated to the highest
66 version mutually supported by the client and the server. The
67 supported protocols are SSLv2, SSLv3, TLSv1, TLSv1.1 and TLSv1.2.
68 Most applications should use these method, and avoid the version
69 specific methods described below.
70
71 The list of protocols available can be further limited using the
72 SSL_OP_NO_SSLv2, SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1,
73 SSL_OP_NO_TLSv1_1 and SSL_OP_NO_TLSv1_2 options of the
74 SSL_CTX_set_options(3) or SSL_set_options(3) functions. Clients
75 should avoid creating "holes" in the set of protocols they support,
76 when disabling a protocol, make sure that you also disable either
77 all previous or all subsequent protocol versions. In clients, when
78 a protocol version is disabled without disabling all previous
79 protocol versions, the effect is to also disable all subsequent
80 protocol versions.
81
82 The SSLv2 and SSLv3 protocols are deprecated and should generally
83 not be used. Applications should typically use
84 SSL_CTX_set_options(3) in combination with the SSL_OP_NO_SSLv3 flag
85 to disable negotiation of SSLv3 via the above version-flexible
86 SSL/TLS methods. The SSL_OP_NO_SSLv2 option is set by default, and
87 would need to be cleared via SSL_CTX_clear_options(3) in order to
88 enable negotiation of SSLv2.
89
90 TLSv1_2_method(), TLSv1_2_server_method(), TLSv1_2_client_method()
91 A TLS/SSL connection established with these methods will only
92 understand the TLSv1.2 protocol. A client will send out TLSv1.2
93 client hello messages and will also indicate that it only
94 understand TLSv1.2. A server will only understand TLSv1.2 client
95 hello messages.
96
97 TLSv1_1_method(), TLSv1_1_server_method(), TLSv1_1_client_method()
98 A TLS/SSL connection established with these methods will only
99 understand the TLSv1.1 protocol. A client will send out TLSv1.1
100 client hello messages and will also indicate that it only
101 understand TLSv1.1. A server will only understand TLSv1.1 client
102 hello messages.
103
104 TLSv1_method(), TLSv1_server_method(), TLSv1_client_method()
105 A TLS/SSL connection established with these methods will only
106 understand the TLSv1 protocol. A client will send out TLSv1 client
107 hello messages and will indicate that it only understands TLSv1. A
108 server will only understand TLSv1 client hello messages.
109
110 SSLv3_method(), SSLv3_server_method(), SSLv3_client_method()
111 A TLS/SSL connection established with these methods will only
112 understand the SSLv3 protocol. A client will send out SSLv3 client
113 hello messages and will indicate that it only understands SSLv3. A
114 server will only understand SSLv3 client hello messages. The SSLv3
115 protocol is deprecated and should not be used.
116
117 SSLv2_method(), SSLv2_server_method(), SSLv2_client_method()
118 A TLS/SSL connection established with these methods will only
119 understand the SSLv2 protocol. A client will send out SSLv2 client
120 hello messages and will also indicate that it only understand
121 SSLv2. A server will only understand SSLv2 client hello messages.
122 The SSLv2 protocol offers little to no security and should not be
123 used. As of OpenSSL 1.0.2g, EXPORT ciphers and 56-bit DES are no
124 longer available with SSLv2.
125
126 DTLS_method(), DTLS_server_method(), DTLS_client_method()
127 These are the version-flexible DTLS methods.
128
129 DTLSv1_2_method(), DTLSv1_2_server_method(), DTLSv1_2_client_method()
130 These are the version-specific methods for DTLSv1.2.
131
132 DTLSv1_method(), DTLSv1_server_method(), DTLSv1_client_method()
133 These are the version-specific methods for DTLSv1.
134
135 SSL_CTX_new() initializes the list of ciphers, the session cache
136 setting, the callbacks, the keys and certificates and the options to
137 its default values.
138
140 The following return values can occur:
141
142 NULL
143 The creation of a new SSL_CTX object failed. Check the error stack
144 to find out the reason.
145
146 Pointer to an SSL_CTX object
147 The return value points to an allocated SSL_CTX object.
148
150 SSL_CTX_set_options(3), SSL_CTX_clear_options(3), SSL_set_options(3),
151 SSL_CTX_free(3), SSL_accept(3), ssl(3), SSL_set_connect_state(3)
152
153
154
1551.0.2o 2018-03-27 SSL_CTX_new(3)