Commit 1e1d93e
authored
bugfix:
When TLSv1.3 is used, the server may send a NewSessionTicket message
after the handshake. While this message is ssl-layer data,
`tcpsock:sslhandshake` does not consume it.
In the implementation of `setkeepalive`, `recv` is used to confirm the
connection is still open and there is no unread data in the buffer. But
it treats the NewSessionTicket message as application layer data and
then `setkeepalive` fails with this error `connection in dubious state`.
In fact we don't need to peek here, because if the application data is
read successfully then the connection is going to be closed anyway.
Therefore, `c->recv` can be used instead which will consume the
ssl-layer data implicitly.setkeepalive failure on TLSv1.31 parent 69f0cd7 commit 1e1d93e
2 files changed
+61
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5595 | 5595 | | |
5596 | 5596 | | |
5597 | 5597 | | |
5598 | | - | |
5599 | | - | |
| 5598 | + | |
5600 | 5599 | | |
5601 | 5600 | | |
5602 | 5601 | | |
| |||
5618 | 5617 | | |
5619 | 5618 | | |
5620 | 5619 | | |
5621 | | - | |
5622 | | - | |
5623 | | - | |
5624 | | - | |
5625 | | - | |
5626 | | - | |
5627 | | - | |
5628 | | - | |
5629 | | - | |
5630 | | - | |
5631 | | - | |
5632 | | - | |
| 5620 | + | |
| 5621 | + | |
5633 | 5622 | | |
5634 | | - | |
| 5623 | + | |
5635 | 5624 | | |
5636 | 5625 | | |
5637 | 5626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
3545 | 3546 | | |
3546 | 3547 | | |
3547 | 3548 | | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
| 3577 | + | |
| 3578 | + | |
| 3579 | + | |
| 3580 | + | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
0 commit comments