Commit a828d21
committed
Fix SSL certificate handling to prevent startup crash
Fixes a critical bug where the application would crash on startup with `FileNotFoundError` when `SSL_CERT_FILE` was set to an empty string. The httpx library (used by OpenAI client) fails when `SSL_CERT_FILE` points to a non-existent file or empty string.
**Changes:**
- Removed empty `SSL_CERT_FILE` and `REQUESTS_CA_BUNDLE` from `docker-compose.yaml`
- Improved SSL certificate validation in `app_factory.py` to handle empty strings before httpx initialization
- Removed unused `document_routes_v2` import (already conditionally loaded in routers)
**Impact:**
- Application now starts successfully without SSL certificate errors
- httpx automatically uses system certificate defaults when `SSL_CERT_FILE` is not set
- Better error handling for invalid certificate paths
Fixes startup crash that prevented Docker containers from running.1 parent 7871626 commit a828d21
3 files changed
Lines changed: 25 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | 420 | | |
430 | 421 | | |
431 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
30 | 29 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
344 | 348 | | |
345 | 349 | | |
346 | 350 | | |
347 | | - | |
348 | | - | |
349 | | - | |
| 351 | + | |
| 352 | + | |
350 | 353 | | |
351 | | - | |
| 354 | + | |
352 | 355 | | |
353 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
354 | 363 | | |
355 | 364 | | |
356 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
50 | 51 | | |
51 | | - | |
52 | | - | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
0 commit comments