This figure illustrates authentication in a multi-tier environment:
The client uses SSL to log in. It provides proof of authentication to the application server, typically using a password or an X.509 certificate. The application server verifies the client authentication and then authenticates itself to the database server. The database server checks the application server authentication, verifies that the client exists, and verifies that the application server has the privilege to connect for this client.