Commit d6f372d
Honour certificate verification mode with custom trust roots (TransportServices)
With custom trustRoots, the TransportServices transports installed a
verify block that anchored the custom roots and then evaluated the
SecTrust exactly as Network.framework configured it — with the default
SSL policy, including hostname matching. The configured
CertificateVerification mode was never consulted, so
.noHostnameVerification behaved like full verification (rejecting any
certificate whose SANs don't cover the endpoint, e.g. private-CA
deployments or IP-dialled peers), and .noVerification still evaluated
and could fail the handshake.
The verify block now honours the mode: .noHostnameVerification
re-policies the trust for SSL use with no hostname before evaluating
(chain validation against the custom roots is unchanged), and
.noVerification installs no verify block at all, matching the Posix
transport's NIOSSL semantics for both modes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 2ca31f0 commit d6f372d
4 files changed
Lines changed: 79 additions & 6 deletions
File tree
- Sources/GRPCNIOTransportHTTP2TransportServices
- Tests/GRPCNIOTransportHTTP2Tests
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
328 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
329 | 343 | | |
330 | 344 | | |
331 | 345 | | |
| |||
337 | 351 | | |
338 | 352 | | |
339 | 353 | | |
340 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
341 | 358 | | |
342 | 359 | | |
343 | 360 | | |
| |||
373 | 390 | | |
374 | 391 | | |
375 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
376 | 403 | | |
377 | 404 | | |
378 | 405 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
443 | 447 | | |
444 | 448 | | |
445 | 449 | | |
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
338 | 342 | | |
339 | 343 | | |
340 | 344 | | |
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
503 | 538 | | |
504 | 539 | | |
505 | 540 | | |
| |||
746 | 781 | | |
747 | 782 | | |
748 | 783 | | |
749 | | - | |
| 784 | + | |
| 785 | + | |
750 | 786 | | |
751 | 787 | | |
752 | 788 | | |
| |||
755 | 791 | | |
756 | 792 | | |
757 | 793 | | |
| 794 | + | |
758 | 795 | | |
759 | 796 | | |
760 | 797 | | |
| |||
766 | 803 | | |
767 | 804 | | |
768 | 805 | | |
| 806 | + | |
769 | 807 | | |
770 | 808 | | |
771 | 809 | | |
| |||
0 commit comments