Commit f15a7b0
Add TLS-PSK authentication support via callback mechanism (#348)
* Add TLS-PSK authentication support via callback mechanism
This adds support for TLS Pre-Shared Key (PSK) authentication, allowing
secure connections without certificates using a shared secret key.
Changes:
- Add psk_cred_handler() builder method to create_webserver
- Add psk_cred_handler_callback typedef for PSK credential lookup
- Implement psk_cred_handler_func() static callback using GnuTLS
- Add MHD_OPTION_GNUTLS_PSK_CRED_HANDLER option when PSK is configured
- Add AM_CONDITIONAL for HAVE_GNUTLS in configure.ac
- Remove deprecated AC_HEADER_STDC macro
- Add minimal_https_psk example demonstrating PSK usage
- Add conditional GnuTLS linking in test/Makefile.am
- Update README.md with PSK documentation and example
The callback receives a username and returns the hex-encoded PSK,
or an empty string for unknown users.
* Update GitHub Actions to v4 (cache and checkout)
* Fix linker error: link all examples against gnutls when available
The library now uses GnuTLS functions (gnutls_malloc, gnutls_free,
gnutls_hex2bin) for PSK support, so all examples need to link against
gnutls when HAVE_GNUTLS is defined, not just the PSK example.
* Update CI for Ubuntu 24.04 compatibility
- Update sanitizer builds (asan, lsan, tsan, ubsan) from clang-13 to clang-18
- Move clang-11, clang-12, clang-13 tests to ubuntu-22.04
- Add new clang-14 through clang-17 tests on ubuntu-latest
- Add gcc-11 through gcc-14 tests
- Remove obsolete ubuntu-20.04 jobs (gcc-7, gcc-8, clang-6 through clang-10)
- Update IWYU job to use clang-18 on ubuntu-latest
- Fix cpplint errors: add missing includes and fix namespace indentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix valgrind CI job for Ubuntu 24.04
- Remove valgrind-dbg package (debug symbols now included in main package)
- Update valgrind job to use GCC 14 instead of GCC 10
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Use GCC 13 for valgrind job to avoid -Woverloaded-virtual error
GCC 14 with -Werror catches a latent warning in littletest.hpp test
framework that older compilers don't flag. Use GCC 13 for now.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix issues with valgrind running on g++-14
* FIx issue with overloads in tests
* Fix issue with gnutls
* Fix all cpplint issues
* Added codacy suppressions
* No need for codacy yaml. It is configured via UI
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent dff6af2 commit f15a7b0
File tree
42 files changed
+355
-77
lines changed- .github/workflows
- examples
- src
- httpserver
- test
- integ
- unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
42 files changed
+355
-77
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
| 126 | + | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
146 | 155 | | |
147 | 156 | | |
148 | 157 | | |
149 | | - | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
153 | | - | |
154 | | - | |
| 162 | + | |
| 163 | + | |
155 | 164 | | |
156 | 165 | | |
157 | 166 | | |
158 | | - | |
| 167 | + | |
159 | 168 | | |
160 | 169 | | |
161 | 170 | | |
162 | | - | |
163 | | - | |
| 171 | + | |
| 172 | + | |
164 | 173 | | |
165 | 174 | | |
166 | 175 | | |
167 | | - | |
| 176 | + | |
168 | 177 | | |
169 | 178 | | |
170 | 179 | | |
171 | | - | |
172 | | - | |
| 180 | + | |
| 181 | + | |
173 | 182 | | |
174 | 183 | | |
175 | 184 | | |
176 | | - | |
| 185 | + | |
177 | 186 | | |
178 | 187 | | |
179 | 188 | | |
180 | | - | |
181 | | - | |
| 189 | + | |
| 190 | + | |
182 | 191 | | |
183 | 192 | | |
184 | 193 | | |
185 | 194 | | |
186 | 195 | | |
187 | 196 | | |
188 | 197 | | |
189 | | - | |
190 | | - | |
| 198 | + | |
| 199 | + | |
191 | 200 | | |
192 | 201 | | |
193 | 202 | | |
194 | 203 | | |
195 | 204 | | |
196 | 205 | | |
197 | 206 | | |
198 | | - | |
199 | | - | |
| 207 | + | |
| 208 | + | |
200 | 209 | | |
201 | 210 | | |
202 | 211 | | |
203 | 212 | | |
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
207 | | - | |
208 | | - | |
| 216 | + | |
| 217 | + | |
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
212 | 221 | | |
213 | 222 | | |
214 | 223 | | |
215 | 224 | | |
216 | | - | |
217 | | - | |
| 225 | + | |
| 226 | + | |
218 | 227 | | |
219 | 228 | | |
220 | 229 | | |
221 | | - | |
| 230 | + | |
222 | 231 | | |
223 | 232 | | |
224 | 233 | | |
225 | | - | |
226 | | - | |
| 234 | + | |
| 235 | + | |
227 | 236 | | |
228 | 237 | | |
229 | 238 | | |
| |||
264 | 273 | | |
265 | 274 | | |
266 | 275 | | |
267 | | - | |
| 276 | + | |
268 | 277 | | |
269 | 278 | | |
270 | 279 | | |
| |||
294 | 303 | | |
295 | 304 | | |
296 | 305 | | |
297 | | - | |
| 306 | + | |
298 | 307 | | |
299 | 308 | | |
300 | 309 | | |
| |||
303 | 312 | | |
304 | 313 | | |
305 | 314 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 315 | + | |
311 | 316 | | |
312 | 317 | | |
313 | 318 | | |
314 | 319 | | |
315 | | - | |
| 320 | + | |
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
| |||
321 | 326 | | |
322 | 327 | | |
323 | 328 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
328 | 332 | | |
| 333 | + | |
329 | 334 | | |
330 | 335 | | |
331 | 336 | | |
| |||
341 | 346 | | |
342 | 347 | | |
343 | 348 | | |
344 | | - | |
| 349 | + | |
345 | 350 | | |
346 | 351 | | |
347 | 352 | | |
| |||
352 | 357 | | |
353 | 358 | | |
354 | 359 | | |
355 | | - | |
| 360 | + | |
356 | 361 | | |
357 | 362 | | |
358 | 363 | | |
| |||
386 | 391 | | |
387 | 392 | | |
388 | 393 | | |
389 | | - | |
| 394 | + | |
390 | 395 | | |
391 | | - | |
392 | | - | |
| 396 | + | |
| 397 | + | |
393 | 398 | | |
394 | 399 | | |
395 | 400 | | |
396 | | - | |
397 | | - | |
398 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
399 | 404 | | |
400 | 405 | | |
401 | 406 | | |
402 | | - | |
| 407 | + | |
403 | 408 | | |
404 | | - | |
| 409 | + | |
405 | 410 | | |
406 | 411 | | |
407 | 412 | | |
| |||
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
424 | | - | |
| 429 | + | |
425 | 430 | | |
426 | 431 | | |
427 | 432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
| |||
346 | 347 | | |
347 | 348 | | |
348 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
349 | 403 | | |
350 | 404 | | |
351 | 405 | | |
| |||
0 commit comments