ShooterGame demonstrates the issue where when encryption is enabled, if the (unencrypted) EncryptionAck message is dropped, the resent messages will be encrypted since the server has enabled encryption at that point. The fix is to add & utilize FNetDelegates::OnPendingNetGameConnectionCreated instead of ReceivedNetworkEncryptionAck for setting the key, so that the key would be set before any messages from the server arrived on the client.

Steps to Reproduce
  1. Start an instance of ShooterGame, for example with UE4Editor ShooterGame -game -ini:Engine:[PacketHandlerComponents]:EncryptionComponent=AESHandlerComponent -pktloss=80. This will be the host.
  2. Start the client instance with UE4Editor ShooterGame -game -ini:Engine:[PacketHandlerComponents]:EncryptionComponent=AESHandlerComponent.
  3. Host a LAN match with the host instance.
  4. Have the client join.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to AnswerHub just mention UE-95508 in the post.

Login to Vote

Affects Versions4.25.2
CreatedJul 17, 2020
UpdatedFeb 11, 2021