JAVA-6015ClosedFixed

Improve error message for unexpected EOF from KMS

When communicating with KMS for CSFLE, the  Crypt.decryptKey wraps bytes read from the KMS TLS stream using: If InputStream.read(...) on the KMS connection returns -1 (EOF), bytesRead is negative and ByteBuffer.wrap(...) throws IndexOutOfBoundsException with no message. This surfaces to users as: *Proposed change* Throw a more informative exception, for example: MongoClientException("Unexpected EOF while communicating with KMS") *Acceptance criteria* * When KMS closes the TLS strea

Affected Versions
Versions known to exhibit this issue
3.12.11
Fixed Versions
Versions that include the fix
5.6.2
Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.