You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client Hello carries not SNI, signature schemes and ALPN protocols.
- Added a base.rs for structs providing strings, string arrays and
short arrays to C callback functions.
- Extended rustls_client_hello, adapted the prototype and added
documentation.
- Made a section about EXPERIMENTAL features in the README.md
Copy file name to clipboardExpand all lines: README.md
+38Lines changed: 38 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -114,3 +114,41 @@ Functions that are theoretically infallible don't return rustls_result, so we
114
114
can't return RUSTLS_RESULT_PANIC. In those cases, if there's a panic, we'll
115
115
return a default value suitable to the return type: NULL for pointer types,
116
116
false for bool types, and 0 for integer types.
117
+
118
+
# Experimentals
119
+
120
+
Several features of the C bindings are marked as `EXPERIMENTAL` as they are
121
+
need further evaluation and will most likely change significantly in the future.
122
+
123
+
## Server Side Experimentals
124
+
125
+
The `rustls_server_config_builder_set_hello_callback` and its provided information
126
+
in `rustls_client_hello` will change. The current design is a snapshot of the
127
+
implementation efforts in [mod_tls](https://github.com/icing/mod_tls) to provide
128
+
`rustls` base TLS as module for the Apache webserver.
129
+
130
+
For a webserver hosting multiple domains on the same endpoint, it is highly desirable
131
+
to have individual TLS settings, depending on the domain the client wants to talk to.
132
+
Most domains have their own TLS certificates, some have configured restrictions on
133
+
other features as well, such as TLS protocol versions, ciphers or client authentication.
134
+
135
+
The approach to this taken with the current `rustls_client_hello` is as follows:
136
+
137
+
#### One domain, one cert
138
+
139
+
If you have a single site and one certificate, you can preconfigure the `rustls_server_config` accordingly and do not need to register any callback.
140
+
141
+
#### Multiple domains/certs/settings
142
+
143
+
If you need to support multiple `rustls_server_config`s on the same connection endpoint, you can start the connection with a default `rustls_server_config` and register a client hello callback. The callback inspects the SNI/ALPN/cipher values announced by the client and selects the appropriate configuration to use.
144
+
145
+
When your callback returns, the handshake of `rustls` will fail, as no certifcate was configured. This will be noticeable as an error returned from `rustls_server_session_write_tls()`. You can then free this session
146
+
and create the one with the correct setting for the domain chosen.
147
+
148
+
For this to work, your connection needs ot buffer the initial data from the client, so these bytes can be
149
+
replayed to the second session you use. Do not write any data back to the client while your are
150
+
in the initial session. The client hellos are usually only a few hundred bytes.
0 commit comments