When you connect to a MySQL Database with MariaDB npm package you might face this error. To fix this just add "allowPublicKeyRetrieval": true to your connection properties. In my case I added this property to my connection pool config.

Read more of this post