Context and assumptions:

  • TLS 1.2 or 1.3, server authentication only
  • Client uses HMAC to authenticate itself to the server, using a PSK key
  • Client is a library, not a web browser, which doesn't allow to "click-through" certificate errors
  • Security of TLS itself is not compromised in any way, e.g. by adding rogue certificates to client-side truststore or rogue server using revoked server certificate with private key before the revocation information made its way to the client through OCSP/CRL

What would be the benefits of additional layer of security in form of server authentication using HMAC with another PSK?

  • 2
    The question is not about cryptography, but about security. I suggest to move it to Security SE.
    – mentallurg
    Commented Dec 31, 2021 at 19:54

2 Answers 2


An additional authentication is helpful if one does not sufficiently trust the existing authentication. This might be done because the authentication concept is not considered sufficiently secure or its specific implementation - which is likely less of a concern when using established TLS libraries. Authentication might also considered insufficiently trusted if too much is controlled by a not fully trusted third party, like when using a third-party CA issuing the certificates. In these cases additional authentication is used as part of a defense in depth strategy.

Additional authentication can also be useful if the existing authentication does not provide all necessary information or if it authenticates different things or things with a different granularity or scope. For example one authentication might be used for multiple services on the same machine while another might be used to identity a specific service independent of the machine it runs on.

If none of this is the case an additional authentication might just be a burden which does not add significant value but mainly needlessly adds complexity.


In addition to what Steffen Ullrich's excellent answer mentions, it can be authentication at different layers.

TLS authenticates the server, and only the server. HMAC may be used to authenticate individual messages from the application. This may be useful in some scenarios where you use a reverse proxy that terminates TLS, e.g. CloudFlare or some other CDN. Depending on your configuration, this may improve the security of your system.

You must log in to answer this question.