function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
clouddev@surashriclouddev@surashri 

System.CalloutException: java.security.cert.CertificateException - New to this concept - Please help

Hi,

 

I have a visual force page

 

<apex:page controller="callOutUsingHTTP">
    <apex:form >
        <apex:pageBlock title="My Content" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!callOutMethod}" value="GET"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>  
</apex:page>

 I am calling a callout  method which is a requesting some data from our internal web server.

 

The class and function is as

 

public class callOutUsingHTTP
{
    public void callOutMethod()
    {
        HttpRequest req = new HttpRequest();
        req.setEndpoint('https://testing.xxxxxx.com/xxxxxx/xxxxxx/GetAPIInfo?method=CCCCCCCC');
        req.setMethod('GET');
        req.setHeader('username', 'UUUUUUU');
        req.setHeader('password', 'PPPPPPP');
        req.setHeader('LicenseKey', 'some-value-here');
        req.setClientCertificateName('testCallOutCert');

        system.debug('HttpRequest - ' + req);

        Http http = new Http();
        HTTPResponse res = http.send(req);
        System.debug(res.getBody());
    }
}


I have also registered this server at setup->security controls -> remote site settings.

 

I am getting error as mentioed in subject line. 

 

Can someone please let me know the missing link here?

 

It will help a lot.

 

Thanks,

 

clouddev@surashri.