ecc – wrong curve error during TLS handshake with vsftpd

I’m working on a project with a client based on mbedtls and a server built with vsftpd.

I had basic RSA authentication working but am now upgrading to using the cipher TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256. And I am struggling to get it to work:

I see the handshake taking place and server and client agree on the above cipher.I had validate_cert=YES in vsftpd.conf but it then would not be able to validate it and I got certificate verify failed errors in vsftpd.log.

I decided to temporarily turn validation off (validate_cert=NO). I then saw the following error (in vsftpd.log) during the handshake: routines:tls12_check_peer_sigalg:wrong curve

How do I make sure that my vsftpd works with the correct curve?

openssl x509 -text gives me: NIST CURVE: P-384 for the ca-cert