X.509 authentication issues

The Android app is showing an odd behavior when using x.509 certificates for user authentication.

I have nginx as a reverse proxy that handles the authentication. It works flawlessly on my browser. But when I use the android app I get an http 400 error. When I close the app and try again the access is usually granted.
I could not work out why the first request fails.

Any thoughts on this?

The best way to track this down is to run tail -f /var/log/nginx/error.log (or similar) and to open the app. Additionally you could capture a log from the app to see if any exceptions or errors occure.