SSL Certificate error when connecting to elastic search from python

In elasticsearch.yml I have set up the following configurations.

xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate 
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12 
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12 

The certificates were generated from the steps mentioned in the below page

But to generate a client certificate we used the steps mentioned in the below link.

under Creating a client certificate.

So I believe its the same CA that signs both certificates that are configured in ES as well as the client certs. And I think that is why kibana is working with Elasticsearch. Because both are signed with the CA elastic-stack-ca.p12.