Commit 1859885
committed
fix: invalid TLS CA cert should error immediately
Previously if a consumer specified the CA cert to verify the command
connection but that CA wasn't valid then system would log at
Debug (default hidden) and proceed anyways.
I don't believe this is good behavior. If the consumer is directly
specifying a CA cert then that is the CA that should be used, not
silently ignored.
This patch returns the error up, which is now caught and swallowed at
a higher level, but at least it is more visible:
> time=2025-05-21T15:41:33.547Z level=ERROR msg="Unable to add transport credentials to gRPC dial options, adding default transport credentials" error="invalid CA cert while building transport credentials: read CA file (/etc/nginx-agent/bad.crt): open /etc/nginx-agent/bad.crt: no such file or directory"1 parent 50e82ed commit 1859885
2 files changed
+6
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
386 | | - | |
387 | | - | |
| 385 | + | |
| 386 | + | |
388 | 387 | | |
389 | 388 | | |
390 | | - | |
391 | | - | |
392 | | - | |
| 389 | + | |
| 390 | + | |
393 | 391 | | |
394 | 392 | | |
395 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 454 | + | |
458 | 455 | | |
459 | 456 | | |
460 | 457 | | |
| |||
0 commit comments