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
jdlforcejdlforce 

HTTPS callout

Hi - I need your help making http calls over SSL.

 

I have a PKCS12 certificate but it is all encrypted. Should I convert that into base64 format?

This is my first time doing this so any help will be appreciated.

 

Here the code I using and I am getting -> System.CalloutException: DER input, Integer tag error

 

Http http = new Http();

HttpRequest req1 = new HttpRequest();

 

req1.setEndpoint('https://mysite/IGetAccountHist?billingKey=639153529727');

req1.setHeader('Content-Type', 'text/xml');

req1.setClientCertificate('MIIDEjCCAnugAwIBAgIBjocsanCBnDELMAkGA1UEBhMCQ0ExCzAJBgNVBAgTAkJDMRIwEAYDVQQHEwlWYW5jb3V2ZXIxDTALBgNVBAoTBGFpckcxFzAVBgNVBAsTDk9wZXJhdGlvbiBUZWFtMSIwIAYDVQQDExlzZnByb3h5LnFhLWRhdmlkZy5haXJnLnVzMSAwHgYJKoZIhvcNAQkBFhFzeXNhZG1pbkBhaXJnLmNvbTAeFw0wOTEyMDcyMzU4MTJaFw0xMDEyMDcyMzU4MTJaMIGPMQswCQYDVQQGEwJDQTELMAkGA1UECBMCQkMxEjAQBgNVBAcTCVZhbmNvdXZlcjENMAsGA1UEChMEYWlyRzEXMBUGA1UECxMOT3BlcmF0aW9uIFRlYW0xFTATBgNVBAMTDHd3dy5haXJnLmNvbTEgMB4GCSqGSIb3DQEJARYRc3lzYWRtaW5AYWlyZy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANWESs+MMbF3hum09rsygEicKfqkb/dupARP1OSUzVlml1Ym+dMoOiGY4CwUrsBwB9Zv/S0bd4uvqOFyLZMU6xc/xT3cKAWDuzs2DlSb6HbstZlWiwHr9VFuyNKmkUtpBX2tLSZL69aqkD+wAIJZpFBGIdYywCe4iLrhcdH9cOWJAgMBAAGjbzBtMBwGA1UdEQQVMBOBEXN5c2FkbWluQGFpcmcuY29tMDoGCWCGSAGG+EIBDQQtFittb2Rfc3NsIGdlbmVyYXRlZCBjdXN0b20gc2VydmVyIGNlcnRpZmljYXRlMBEGCWCGSAGG+EIBAQQEAwIGQDANBgkqhkiG9w0BAQQFAAOBgQBzI3pWfIAdW1Gw9ccS+I67xTr04JdJTEmy7BIF/DRbJwdUhs1MiCLS6tPbEVFe6pvLG8bjX/O7d0h8+9nAfaoZWrgzotV8FWE0Bw9ca01yiac2e5A8F2M/NuX9cwES1+QaUgEU9UIky6LqHCVTnpRaIMDDFdnFI6lzI6JBCE/XTw==','');

req1.setMethod('GET');

 

System.debug(req1.getBody()); 

 

Thanks, JDL 

Best Answer chosen by Admin (Salesforce Developers) 
jdlforcejdlforce
All I needed was to have a certificate from a "valid" certificate issuer. Salesforce has a list of valid issuer.