Commit 4c72485
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 <[email protected]>1 parent 4ba9aa6 commit 4c72485
1 file changed
+15
-9
lines changed| 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