update libressl to 2.8.2
[unleashed.git] / lib / libssl / man / SSL_CTX_set_ssl_version.3
blobeb29af620c2ac8c4d862fcc0720b6c40cfb15cb3
1 .\"     $OpenBSD: SSL_CTX_set_ssl_version.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2 .\"     OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3 .\"
4 .\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5 .\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project.  All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\"
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\"
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in
16 .\"    the documentation and/or other materials provided with the
17 .\"    distribution.
18 .\"
19 .\" 3. All advertising materials mentioning features or use of this
20 .\"    software must display the following acknowledgment:
21 .\"    "This product includes software developed by the OpenSSL Project
22 .\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23 .\"
24 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25 .\"    endorse or promote products derived from this software without
26 .\"    prior written permission. For written permission, please contact
27 .\"    openssl-core@openssl.org.
28 .\"
29 .\" 5. Products derived from this software may not be called "OpenSSL"
30 .\"    nor may "OpenSSL" appear in their names without prior written
31 .\"    permission of the OpenSSL Project.
32 .\"
33 .\" 6. Redistributions of any form whatsoever must retain the following
34 .\"    acknowledgment:
35 .\"    "This product includes software developed by the OpenSSL Project
36 .\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37 .\"
38 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
42 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
50 .\"
51 .Dd $Mdocdate: March 27 2018 $
52 .Dt SSL_CTX_SET_SSL_VERSION 3
53 .Os
54 .Sh NAME
55 .Nm SSL_CTX_set_ssl_version ,
56 .Nm SSL_set_ssl_method ,
57 .Nm SSL_get_ssl_method
58 .Nd choose a new TLS/SSL method
59 .Sh SYNOPSIS
60 .In openssl/ssl.h
61 .Ft int
62 .Fn SSL_CTX_set_ssl_version "SSL_CTX *ctx" "const SSL_METHOD *method"
63 .Ft int
64 .Fn SSL_set_ssl_method "SSL *s" "const SSL_METHOD *method"
65 .Ft const SSL_METHOD *
66 .Fn SSL_get_ssl_method "SSL *ssl"
67 .Sh DESCRIPTION
68 .Fn SSL_CTX_set_ssl_version
69 sets a new default TLS/SSL
70 .Fa method
71 for
72 .Vt SSL
73 objects newly created from this
74 .Fa ctx .
75 .Vt SSL
76 objects already created with
77 .Xr SSL_new 3
78 are not affected, except when
79 .Xr SSL_clear 3
80 is called.
81 .Pp
82 .Fn SSL_set_ssl_method
83 sets a new TLS/SSL
84 .Fa method
85 for a particular
86 .Vt SSL
87 object
88 .Fa s .
89 It may be reset when
90 .Xr SSL_clear 3
91 is called.
92 .Pp
93 .Fn SSL_get_ssl_method
94 returns a function pointer to the TLS/SSL method set in
95 .Fa ssl .
96 .Pp
97 The available
98 .Fa method
99 choices are described in
100 .Xr SSL_CTX_new 3 .
102 When
103 .Xr SSL_clear 3
104 is called and no session is connected to an
105 .Vt SSL
106 object, the method of the
107 .Vt SSL
108 object is reset to the method currently set in the corresponding
109 .Vt SSL_CTX
110 object.
111 .Sh RETURN VALUES
112 The following return values can occur for
113 .Fn SSL_CTX_set_ssl_version
115 .Fn SSL_set_ssl_method :
116 .Bl -tag -width Ds
117 .It  0
118 The new choice failed.
119 Check the error stack to find out the reason.
120 .It  1
121 The operation succeeded.
123 .Sh SEE ALSO
124 .Xr ssl 3 ,
125 .Xr SSL_clear 3 ,
126 .Xr SSL_CTX_new 3 ,
127 .Xr SSL_new 3 ,
128 .Xr SSL_set_connect_state 3
129 .Sh HISTORY
130 .Fn SSL_CTX_set_ssl_version ,
131 .Fn SSL_set_ssl_method ,
133 .Fn SSL_get_ssl_method
134 first appeared in SSLeay 0.8.0 and have been available since
135 .Ox 2.4 .