• acmegx765432345678
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

I'm trying to make an apex callout to external secured (HTTPS) web service and I'm getting the following exception:

 

common.apex.runtime.impl.ExecutionException: IO Exception: toDerInputStream rejects tag type 77"|0x24444ac2

 

The external web service is a Cast Iron Web Service. CA signed certificate is imported into Cast Iron.

 

Here are the steps I followed:

 

1. I exported the key along with the password from the Cast Iron WMC.

2. Added the following code:

instance.endpoint_x         = 'https://server.mycompany.com/mywebservice';
        instance.inputHttpHeaders_x = new Map<String, String>();
        updateStatusInstance.inputHttpHeaders_x.put('OrganizationId', UserInfo.getOrganizationId());
        String sKey = ''; // the key that was exported from Cast Iron
        Blob keyBlob = Blob.valueOf(sKey);
        String sKeyBase64 = EncodingUtil.base64Encode(keyBlob);
        updateStatusInstance.clientCert_x = sKeyBase64;
        updateStatusInstance.clientCertPasswd_x = 'password';
        updateStatusInstance.timeout_x          = 60000;

 

I followed the advice from the following threads/blogs, but I still getting this error. It looks like the error happens if the key is of DER type. But when I exported the key, I did select the PKCS#12 format.

 

http://boards.developerforce.com/t5/Apex-Code-Development/Mutual-SSL-on-WebSvc-callouts-getting-a-jump-on-Summer-08/td-p/75898

 

http://techblog.kruelintent.com/post/13821841289/how-to-connecting-to-a-secure-web-service-https-from

 

What am I doing wrong? Any help would be much appreciated.

 

Regards,

Hari Krishnan.