Debian Codegraph @

upstream/debian-unstable/man3/SSL_CTX_set_ssl_version.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "SSL_CTX_SET_SSL_VERSION 3SSL"
58 .TH SSL_CTX_SET_SSL_VERSION 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 SSL_CTX_set_ssl_version, SSL_CTX_get_ssl_method, SSL_set_ssl_method, SSL_get_ssl_method
65 \&\- choose a new TLS/SSL method
66 .SH SYNOPSIS
67 .IX Header "SYNOPSIS"
68 .Vb 1
69 \& #include <openssl/ssl.h>
70 \&
71 \& int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *method);
72 \& const SSL_METHOD *SSL_CTX_get_ssl_method(const SSL_CTX *ctx);
73 \&
74 \& int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method);
75 \& const SSL_METHOD *SSL_get_ssl_method(const SSL *ssl);
76 .Ve
77 .SH DESCRIPTION
78 .IX Header "DESCRIPTION"
79 \&\fBSSL_CTX_set_ssl_version()\fR sets a new default TLS/SSL \fBmethod\fR for SSL objects
80 newly created from this \fBctx\fR. Most of the configuration attached to the
81 SSL_CTX object is retained, with the exception of the configured TLS ciphers,
82 which are reset to the default values. SSL objects already created from this
83 SSL_CTX with \fBSSL_new\fR\|(3) are not affected, except when \fBSSL_clear\fR\|(3) is
84 being called, as described below.
85 .PP
86 \&\fBSSL_CTX_get_ssl_method()\fR returns the SSL_METHOD which was used to construct the
87 SSL_CTX.
88 .PP
89 \&\fBSSL_set_ssl_method()\fR sets a new TLS/SSL \fBmethod\fR for a particular \fBssl\fR
90 object. It may be reset, when \fBSSL_clear()\fR is called.
91 .PP
92 \&\fBSSL_get_ssl_method()\fR returns a pointer to the TLS/SSL method
93 set in \fBssl\fR.
94 .SH NOTES
95 .IX Header "NOTES"
96 The available \fBmethod\fR choices are described in
97 \&\fBSSL_CTX_new\fR\|(3).
98 .PP
99 When \fBSSL_clear\fR\|(3) is called and no session is connected to
100 an SSL object, the method of the SSL object is reset to the method currently
101 set in the corresponding SSL_CTX object.
102 .PP
103 \&\fBSSL_CTX_set_version()\fR has unusual semantics and no clear use case;
104 it would usually be preferable to create a new SSL_CTX object than to
105 try to reuse an existing one in this fashion. Its usage is considered
106 deprecated.
107 .PP
108 \&\fBSSL_set_ssl_method()\fR cannot be used to change a non-QUIC SSL object to a QUIC
109 SSL object or vice versa, or change a QUIC SSL object from one QUIC method to
110 another.
111 .SH "RETURN VALUES"
112 .IX Header "RETURN VALUES"
113 The following return values can occur for \fBSSL_CTX_set_ssl_version()\fR
114 and \fBSSL_set_ssl_method()\fR:
115 .IP 0 4
116 The new choice failed, check the error stack to find out the reason.
117 .IP 1 4
118 .IX Item "1"
119 The operation succeeded.
120 .PP
121 \&\fBSSL_CTX_get_ssl_method()\fR and \fBSSL_get_ssl_method()\fR always return non-NULL
122 pointers.
123 .SH "SEE ALSO"
124 .IX Header "SEE ALSO"
125 \&\fBSSL_CTX_new\fR\|(3), \fBSSL_new\fR\|(3),
126 \&\fBSSL_clear\fR\|(3), \fBssl\fR\|(7),
127 \&\fBSSL_set_connect_state\fR\|(3)
128 .SH HISTORY
129 .IX Header "HISTORY"
130 \&\fBSSL_CTX_set_ssl_version()\fR was deprecated in OpenSSL 3.0.
131 .SH COPYRIGHT
132 .IX Header "COPYRIGHT"
133 Copyright 2000\-2023 The OpenSSL Project Authors. All Rights Reserved.
134 .PP
135 Licensed under the Apache License 2.0 (the "License"). You may not use
136 this file except in compliance with the License. You can obtain a copy
137 in the file LICENSE in the source distribution or at
138 <https://www.openssl.org/source/license.html>.