0

I need your help with the following error:

https://freelance1660443220.api-us1.com
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target
2022-10-04 23:43:01.615 |level= INFO |class=c.a.a.o.a.ActiveCampaignAdapter.28 | 
msg="Success create customer compra.asegurate.kernel.domain.activecampaignsave.entitiesmodelsactivecampaign.ContactObject 
Dto@6ad88683"
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target

Here is my code

@Override
public ListGetAllResponseDto ListGetAll (){

    OkHttpClient client = new OkHttpClient();
    try {

        /*MediaType mediaType = MediaType.parse(APPLICATION_JSON);*/
        Request request = new Request.Builder()
                .url(activeCampaignConfig.getUrlBase() + activeCampaignConfig.getListUrlBase())
                .get()
                .addHeader(ACCEPT, APPLICATION_JSON)
                .addHeader(CONTENT_TYPE, APPLICATION_JSON)
                .addHeader(API_TOKEN, activeCampaignConfig.getApiToken())
                .build();

        Response response = client.newCall(request).execute();
        String data = response.body().string();
        return new Gson().fromJson(data, ListGetAllResponseDto.class);
    } catch (IOException e) {
        System.out.println(e.getMessage());
        return null;
    }
}

Before we were using MongoDB but recently a change to AWS keyspace with Cassandra was requested. Since we started using Cassandra we get the error that I mentioned above. I have tried several solutions but none really works for me.

Abra
  • 19,142
  • 7
  • 29
  • 41

0 Answers0