1.\"
2.\"	$OpenBSD: SSL_CTX_set_ssl_version.3,v 1.1 2016/11/05 15:32:19 schwarze Exp $
3.\"
4.Dd $Mdocdate: November 5 2016 $
5.Dt SSL_CTX_SET_SSL_VERSION 3
6.Os
7.Sh NAME
8.Nm SSL_CTX_set_ssl_version ,
9.Nm SSL_set_ssl_method ,
10.Nm SSL_get_ssl_method
11.Nd choose a new TLS/SSL method
12.Sh SYNOPSIS
13.In openssl/ssl.h
14.Ft int
15.Fn SSL_CTX_set_ssl_version "SSL_CTX *ctx" "const SSL_METHOD *method"
16.Ft int
17.Fn SSL_set_ssl_method "SSL *s" "const SSL_METHOD *method"
18.Ft const SSL_METHOD *
19.Fn SSL_get_ssl_method "SSL *ssl"
20.Sh DESCRIPTION
21.Fn SSL_CTX_set_ssl_version
22sets a new default TLS/SSL
23.Fa method
24for
25.Vt SSL
26objects newly created from this
27.Fa ctx .
28.Vt SSL
29objects already created with
30.Xr SSL_new 3
31are not affected, except when
32.Xr SSL_clear 3
33is called.
34.Pp
35.Fn SSL_set_ssl_method
36sets a new TLS/SSL
37.Fa method
38for a particular
39.Vt SSL
40object
41.Fa s .
42It may be reset when
43.Xr SSL_clear 3
44is called.
45.Pp
46.Fn SSL_get_ssl_method
47returns a function pointer to the TLS/SSL method set in
48.Fa ssl .
49.Sh NOTES
50The available
51.Fa method
52choices are described in
53.Xr SSL_CTX_new 3 .
54.Pp
55When
56.Xr SSL_clear 3
57is called and no session is connected to an
58.Vt SSL
59object, the method of the
60.Vt SSL
61object is reset to the method currently set in the corresponding
62.Vt SSL_CTX
63object.
64.Sh RETURN VALUES
65The following return values can occur for
66.Fn SSL_CTX_set_ssl_version
67and
68.Fn SSL_set_ssl_method :
69.Bl -tag -width Ds
70.It  0
71The new choice failed.
72Check the error stack to find out the reason.
73.It  1
74The operation succeeded.
75.El
76.Sh SEE ALSO
77.Xr ssl 3 ,
78.Xr SSL_clear 3 ,
79.Xr SSL_CTX_new 3 ,
80.Xr SSL_new 3 ,
81.Xr SSL_set_connect_state 3
82