Question: I'm trying to connect to s4 hana system using s4 sdk. While executing calls via .execute() method in cloud foundry environment, i see below error logs: 

```
Caused by: com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException: Failed to get authentication headers. Destination service returned error: Missing private and public key for subaccount ******-****-****-***-*******.

```

Note: I've already configured trust between subaccount and S4Hana system and created respective communication and business user. The associated authentication method used in the destination is oAuth2SamlBearerAssertion. **Note**: The call executes fine in both local and cloud foundry environment with basic authentication. 

Can someone please suggest what is wrong here.

Answer: 
As correctly pointed out by @Dennis H there was a problem in trust configuration between my subaccount and S4 Hana system, the configuration wrong in my case :

-> The certificate I downloaded for trust was using this URL:  

https://.authentication.eu10.hana.ondemand.com/saml/metadata

This is incorrect we need to get the certificate from **download trust** button in destination tab at subaccount level 

->**Provider name** was incorrect in the communication system.
We are developing a side-by-side extension app and deploying it to CF. Our app is trying to connect to S4HANA cloud system using oAUTH2SAMLBEARERASSERTION. But facing issues while doing it. We are getting below error in logs. Please be noted, we are able to connect to S4HANA Cloud using basic auth. 

com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException: Failed to access the configuration of destination

Our destination parameters look as attached screenshot[enter image description here](https://i.stack.imgur.com/XlJdS.jpg)

Thank you.