summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_CTX_set_session_id_context.3
diff options
context:
space:
mode:
authorbentley <>2014-10-12 09:33:04 +0000
committerbentley <>2014-10-12 09:33:04 +0000
commit78332233d01faa45e0bb0b1583d47cb5ad1ddc19 (patch)
treea5087bf8d016a6041c2b6822fbecfd8f6c5e70b1 /src/lib/libssl/doc/SSL_CTX_set_session_id_context.3
parent4e737c824fafe5f105e5f4849a9db2569b5d53d8 (diff)
downloadopenbsd-78332233d01faa45e0bb0b1583d47cb5ad1ddc19.tar.gz
openbsd-78332233d01faa45e0bb0b1583d47cb5ad1ddc19.tar.bz2
openbsd-78332233d01faa45e0bb0b1583d47cb5ad1ddc19.zip
Convert libssl manpages from pod to mdoc(7).
libcrypto has not been started yet. ok schwarze@ miod@
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_session_id_context.3')
-rw-r--r--src/lib/libssl/doc/SSL_CTX_set_session_id_context.3102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_session_id_context.3 b/src/lib/libssl/doc/SSL_CTX_set_session_id_context.3
new file mode 100644
index 0000000000..0411c687a4
--- /dev/null
+++ b/src/lib/libssl/doc/SSL_CTX_set_session_id_context.3
@@ -0,0 +1,102 @@
1.Dd $Mdocdate: October 12 2014 $
2.Dt SSL_CTX_SET_SESSION_ID_CONTEXT 3
3.Os
4.Sh NAME
5.Nm SSL_CTX_set_session_id_context ,
6.Nm SSL_set_session_id_context
7.Nd set context within which session can be reused (server side only)
8.Sh SYNOPSIS
9.In openssl/ssl.h
10.Ft int
11.Fo SSL_CTX_set_session_id_context
12.Fa "SSL_CTX *ctx"
13.Fa const unsigned char *sid_ctx"
14.Fa "unsigned int sid_ctx_len"
15.Fc
16.Ft int
17.Fo SSL_set_session_id_context
18.Fa "SSL *ssl"
19.Fa const unsigned char *sid_ctx"
20.Fa "unsigned int sid_ctx_len"
21.Fc
22.Sh DESCRIPTION
23.Fn SSL_CTX_set_session_id_context
24sets the context
25.Fa sid_ctx
26of length
27.Fa sid_ctx_len
28within which a session can be reused for the
29.Fa ctx
30object.
31.Pp
32.Fn SSL_set_session_id_context
33sets the context
34.Fa sid_ctx
35of length
36.Fa sid_ctx_len
37within which a session can be reused for the
38.Fa ssl
39object.
40.Sh NOTES
41Sessions are generated within a certain context.
42When exporting/importing sessions with
43.Xr i2d_SSL_SESSION 3
44and
45.Xr d2i_SSL_SESSION 3 ,
46it would be possible to re-import a session generated from another context
47(e.g., another application), which might lead to malfunctions.
48Therefore each application must set its own session id context
49.Fa sid_ctx
50which is used to distinguish the contexts and is stored in exported sessions.
51The
52.Fa sid_ctx
53can be any kind of binary data with a given length; it is therefore possible
54to use, for instance, the name of the application, the hostname, the service
55name...
56.Pp
57The session id context becomes part of the session.
58The session id context is set by the SSL/TLS server.
59The
60.Fn SSL_CTX_set_session_id_context
61and
62.Fn SSL_set_session_id_context
63functions are therefore only useful on the server side.
64.Pp
65OpenSSL clients will check the session id context returned by the server when
66reusing a session.
67.Pp
68The maximum length of the
69.Fa sid_ctx
70is limited to
71.Dv SSL_MAX_SSL_SESSION_ID_LENGTH .
72.Sh WARNINGS
73If the session id context is not set on an SSL/TLS server and client
74certificates are used, stored sessions will not be reused but a fatal error
75will be flagged and the handshake will fail.
76.Pp
77If a server returns a different session id context to an OpenSSL client
78when reusing a session, an error will be flagged and the handshake will
79fail.
80OpenSSL servers will always return the correct session id context,
81as an OpenSSL server checks the session id context itself before reusing
82a session as described above.
83.Sh RETURN VALUES
84.Fn SSL_CTX_set_session_id_context
85and
86.Fn SSL_set_session_id_context
87return the following values:
88.Bl -tag -width Ds
89.It 0
90The length
91.Fa sid_ctx_len
92of the session id context
93.Fa sid_ctx
94exceeded
95the maximum allowed length of
96.Dv SSL_MAX_SSL_SESSION_ID_LENGTH .
97The error is logged to the error stack.
98.It 1
99The operation succeeded.
100.El
101.Sh SEE ALSO
102.Xr ssl 3