Commit 5985be5
Only cache TLS sessions after successful connection
Previously, TLS sessions were stored immediately after wrap_socket()
completed, but before the actual TCP connection was established. This
meant we could cache sessions for connections that subsequently failed.
Now sessions are only stored after the connection is fully established
and validated, ensuring we only cache sessions for successful connections.
The session storage logic has been moved from _wrap_socket_from_context()
to _connect_socket(), after _initiate_connection() and _validate_hostname()
have succeeded.
Co-authored-by: mykaul <4655593+mykaul@users.noreply.github.com>1 parent 7a680b6 commit 5985be5
1 file changed
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
| 1049 | + | |
| 1050 | + | |
1058 | 1051 | | |
1059 | 1052 | | |
1060 | 1053 | | |
| |||
1111 | 1104 | | |
1112 | 1105 | | |
1113 | 1106 | | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1114 | 1120 | | |
1115 | 1121 | | |
1116 | 1122 | | |
| |||
0 commit comments