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