Commit d7c6952
Get-DbaNetworkEncryption - Fix malformed pre-login packet causing bytesRead=0
The pre-login byte array had incorrect data-section offsets. With 5 option
headers (5 bytes each) plus a terminator, the headers occupy payload bytes
0-25, so data must start at offset 26 or higher. The original offsets (21-29)
caused VERSION data to overlap with the MARS header and terminator bytes,
producing a malformed TDS pre-login packet that SQL Server rejected by closing
the connection, resulting in NetworkStream.Read() returning 0.
Fixed by simplifying to two options (VERSION + ENCRYPTION) with correct
offsets: VERSION data at payload offset 11, ENCRYPTION data at offset 17,
total packet 26 bytes.
(do Get-DbaNetworkEncryption)
Co-authored-by: Andreas Jordan <[email protected]>1 parent 24eb2dd commit d7c6952
1 file changed
+16
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
171 | 178 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
178 | 185 | | |
179 | 186 | | |
180 | 187 | | |
| |||
0 commit comments