Hi Himanshi Kharayat,
A .p12 is a certificate 'vault' and contains most of the times a client certificate to use for identifying (authorization) against a published API. Because this contains a private key, this requires to handle such files with care and most of the times it's encrypted with a password.
Sometimes, a .p12 contains a CA (Certificate Authority), which is the public certificate (not so secret) for the server which hosts the published API. This is mainly done for internal API's, which do not have a public hostname (like app-test.internal-domain.com). Most cases, this is shared separately as .cer or .crt file and can be configured in the certificates tab of Studio Pro as well (as CA).
Your error indicates that it doesn't trust the server, so that it's a problem with the CA of the the server which hosts the published API.
That the problem does not occur in the swagger means your browser is instructed to allow the certificate, probably because the browser is managed by the company or you clicked on allow certificate yourself.
The easiest way to solve this issue is to use your browser to extract the .cer file from the destination site: open the certificate via your browser by clicking on the details of the site via the URL (something like 'Connection is secure', see image below), open the certificate via the button 'Certificate is valid' and then go to the details tab, click on export. You then can import the cer-file in Studio Pro to instruct Mendix to allow this CA. Mind that these steps probably also needs to be taken on every environment.
Good luck!