1SSL_CTX_SET_SSL_VERSION(3ossl) OpenSSL SSL_CTX_SET_SSL_VERSION(3ossl)
2
3
4
6 SSL_CTX_set_ssl_version, SSL_CTX_get_ssl_method, SSL_set_ssl_method,
7 SSL_get_ssl_method - choose a new TLS/SSL method
8
10 #include <openssl/ssl.h>
11
12 int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *method);
13 const SSL_METHOD *SSL_CTX_get_ssl_method(const SSL_CTX *ctx);
14
15 int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method);
16 const SSL_METHOD *SSL_get_ssl_method(const SSL *ssl);
17
19 SSL_CTX_set_ssl_version() sets a new default TLS/SSL method for SSL
20 objects newly created from this ctx. Most of the configuration
21 attached to the SSL_CTX object is retained, with the exception of the
22 configured TLS ciphers, which are reset to the default values. SSL
23 objects already created from this SSL_CTX with SSL_new(3) are not
24 affected, except when SSL_clear(3) is being called, as described below.
25
26 SSL_CTX_get_ssl_method() returns the SSL_METHOD which was used to
27 construct the SSL_CTX.
28
29 SSL_set_ssl_method() sets a new TLS/SSL method for a particular ssl
30 object. It may be reset, when SSL_clear() is called.
31
32 SSL_get_ssl_method() returns a pointer to the TLS/SSL method set in
33 ssl.
34
36 The available method choices are described in SSL_CTX_new(3).
37
38 When SSL_clear(3) is called and no session is connected to an SSL
39 object, the method of the SSL object is reset to the method currently
40 set in the corresponding SSL_CTX object.
41
42 SSL_CTX_set_version() has unusual semantics and no clear use case; it
43 would usually be preferable to create a new SSL_CTX object than to try
44 to reuse an existing one in this fashion. Its usage is considered
45 deprecated.
46
48 The following return values can occur for SSL_CTX_set_ssl_version() and
49 SSL_set_ssl_method():
50
51 0 The new choice failed, check the error stack to find out the
52 reason.
53
54 1 The operation succeeded.
55
56 SSL_CTX_get_ssl_method() and SSL_get_ssl_method() always return non-
57 NULL pointers.
58
60 SSL_CTX_new(3), SSL_new(3), SSL_clear(3), ssl(7),
61 SSL_set_connect_state(3)
62
64 SSL_CTX_set_ssl_version() was deprecated in OpenSSL 3.0.
65
67 Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
68
69 Licensed under the Apache License 2.0 (the "License"). You may not use
70 this file except in compliance with the License. You can obtain a copy
71 in the file LICENSE in the source distribution or at
72 <https://www.openssl.org/source/license.html>.
73
74
75
763.0.9 2023-07-27 SSL_CTX_SET_SSL_VERSION(3ossl)