TLS not only provides encryption but is also used for integrity checking and authentication. How does it prevent attacks? Let's take one example: Replay Attack. Replay Attack: Occurs when an attacker intercepts and resends an old version of a package or metadata, fooling the client into installing outdated or vulnerable versions. With TLS: It ensures that all communication between the client (your system) and the repository server is encrypted and authenticated. Since TLS uses session keys and timestamps, it can detect when a replay attempt is made. By establishing an encrypted and authenticated session with the server, it ensures that the attacker cannot inject an older version of the metadata or package files without detection, as the integrity and authenticity of the transmission is verified in real-time. The link i sent already explains it well for anyone familiar with how TLS works.