I have .crt and privatekey.pem keys which can be used for making HTTPS GET API request.
We can't use these certificates directly in mulesoft for making https API requests.
As far I know it supports Trust store configuration and Key store configuration in the JCEKS, JKS and PKCS12 formats
I have tried using the command below
openssl x509 -outform der -in certificate.private.pem -out certificate.der
keytool -import -alias your-alias -keystore cacerts -file certificate.der
It's failing with the error below after running openssl command mentioned below
unable to load certificate
140706477451034:error:09A2F34C:PEM routines:CRYPTO_internal:no start line:/Library/BuildRoots/97f7341o-dq75-11ed-a4bc-863efbbaf86g/Library/Caches/Sources/libressl/libressl-3.3/crypto/pem/pem_lib.c:694:Expecting: TRUSTED CERTIFICATE
how I can convert my keys to these specific formats and how I can use it while making https get requests from Mulesoft's Anypoint Studio
I didn't find a right article for converting .CRT and .PEM files to Mule supported file formats.
We can convert the two
.crtandprivatekey.pemfiles into a singleJKSfile, as required by the Mule HTTP connector for sendingHTTPSGETrequests with certificatesThe commands to convert
.crtandprivatekey.pemcerts intoJKSfiles are listed below.The
keystore.jksfile will be created and then placed in the mule's projectsrc/main/resourcefolder as seen in the picture below.After adding it, click on
+under Basic Settings to add a http connector and set a configuration similar to the one shown in the following picture.Finally, provide the
GETmethod and thePathas per your API and then deploy the Mule application. It's done.