1 | /* |
---|
2 | * Copyright 2015-2020 Fiona Klute |
---|
3 | * |
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
5 | * you may not use this file except in compliance with the License. |
---|
6 | * You may obtain a copy of the License at |
---|
7 | * |
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
9 | * |
---|
10 | * Unless required by applicable law or agreed to in writing, software |
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
13 | * See the License for the specific language governing permissions and |
---|
14 | * limitations under the License. |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef __MOD_GNUTLS_PROXY_H__ |
---|
18 | #define __MOD_GNUTLS_PROXY_H__ |
---|
19 | |
---|
20 | #include <apr_errno.h> |
---|
21 | #include <apr_pools.h> |
---|
22 | #include <httpd.h> |
---|
23 | |
---|
24 | /** proxy modules may add a note with this key to the |
---|
25 | * connection->notes table for client connections to indicate the |
---|
26 | * server hostname */ |
---|
27 | #define PROXY_SNI_NOTE "proxy-request-hostname" |
---|
28 | |
---|
29 | /** proxy modules may add a note with this key to the connection->notes |
---|
30 | * table for client connections to indicate supported protocols */ |
---|
31 | #define PROXY_ALPN_NOTE "proxy-request-alpn-protos" |
---|
32 | |
---|
33 | apr_status_t load_proxy_x509_credentials(apr_pool_t *pconf, |
---|
34 | apr_pool_t *ptemp, |
---|
35 | server_rec *s) |
---|
36 | __attribute__((nonnull)); |
---|
37 | |
---|
38 | /** |
---|
39 | * Configure extensions for the TLS handshake on proxy connections, |
---|
40 | * currently SNI and ALPN. |
---|
41 | */ |
---|
42 | void mgs_set_proxy_handshake_ext(mgs_handle_t * ctxt); |
---|
43 | |
---|
44 | /** |
---|
45 | * Create a cache key for a session ticket of a proxy connection. |
---|
46 | * |
---|
47 | * @param ctxt The proxy connection handle (mod_gnutls is client) |
---|
48 | * |
---|
49 | * @param pool Pool to allocate the string from, if `NULL` the |
---|
50 | * connection pool is used |
---|
51 | * |
---|
52 | * @return `gnutls_datum_t` containing the string to be used as cache |
---|
53 | * key as `data` and its size (`strlen()`) as `size`. |
---|
54 | */ |
---|
55 | gnutls_datum_t mgs_proxy_ticket_id(mgs_handle_t *ctxt, apr_pool_t *pool); |
---|
56 | |
---|
57 | /** |
---|
58 | * `gnutls_handshake_hook_func` to handle incoming session tickets on |
---|
59 | * proxy connections. |
---|
60 | */ |
---|
61 | int mgs_proxy_got_ticket_func(gnutls_session_t session, |
---|
62 | unsigned int htype, |
---|
63 | unsigned when, |
---|
64 | unsigned int incoming __attribute__((unused)), |
---|
65 | const gnutls_datum_t *msg __attribute__((unused))); |
---|
66 | |
---|
67 | #endif /* __MOD_GNUTLS_PROXY_H__ */ |
---|