Problems working on Authentication using X.509

In one of the homeworks (M310).

I try to connect to a server using mongo shell and get this response:

vagrant@database:~$ mongo --port 31130 --ssl --sslPEMKeyFile ./shared/certs/client.pem --sslCAFile ./shared/certs/ca.pem
MongoDB shell version: 3.2.22
connecting to: 127.0.0.1:31130/test
2020-11-18T06:17:48.934+0000 E NETWORK [thread1] The server certificate does not match the host name 127.0.0.1
2020-11-18T06:17:48.935+0000 E QUERY [thread1] Error: socket exception [CONNECT_ERROR] for The server certificate does not match the host name 127.0.0.1 :
connect@src/mongo/shell/mongo.js:231:14
@(connect):1:6

exception: connect failed
vagrant@database:~$

I don’t know what to do because I only see one file “ca.pem” and one “client.pem”. So I don’see how there can be a mismatch.

I guess the real problem is somewhere else in what I did before, but I have no idea how to find it. Any suggestion will be highly appreciated.

You are missing --host parameter in your command
Use FQDN

I created an updated post for this question.
-> Problems on M310 / X.509