5

Situation

I enabled SSL for one of our Force.com Sites. The website is available and all SSL certs are working fine.

I noticed that SSL doesn't work in case you are using getContent(). As you can see below I implemented a APEX Class:

public with sharing class SalesforceTestCase {
    public String content {get; set;}
    public SalesforceTestCase() {
        try
        {
        PageReference pr = new PageReference('/apex/MyPage');
        content = pr.getContent().toString();
        }
        catch(Exception e)
        {
            content = e.getMessage();
        }
    }
}

And in addition a Visualforce page to show the variable content.

<apex:page controller="SalesforceTestCase" showHeader="false" sidebar="false" standardStylesheets="false" >
    {!content}
</apex:page>

Test case

It works fine without HTTPS:

http://www.die-akademie.de/SalesforceTestCase

But in the moment you are using HTTPS the site fails:

https://www.die-akademie.de/SalesforceTestCase

Question

How can I fix this issue? Does it have anything to do with getContent()?

1 Answer 1

1

It has a very simple Solution.

For the site https://www.die-akademie.de/SalesforceTestCase upload SSL certificate which is CA signed. All other circuits are rejected by Salesforce or behave in unexpected way.

Error standard description:

When the peer was not able to identify itself (for example; no certificate, the particular cipher suite being used does not support authentication, or no peer authentication was established during SSL handshaking) this exception is thrown.

issue

7
  • Hey thanks for your comment. You are right. Except: The certificate is CA signed. This can be simply verified by acting the page die-akademie.de/SalesforceTestCase. The certificate was signed by AlphaSSL. Jul 24, 2015 at 14:34
  • @ChristianDeckert did you try accessing the site in browser. I got error as shown in answer.
    – Ashwani
    Jul 24, 2015 at 17:09
  • which android version? And which device? Jul 24, 2015 at 23:29
  • ChristianDeckert it is Android 5.0.1 running on Samsung Galaxy Note 4.
    – Ashwani
    Jul 25, 2015 at 1:18
  • @ChristianDeckert Did you ever figure this out? I'm experiencing the same issue. PageReference getContent seems to fail when using a custom SSL certificate, even when it is CA-Signed.
    – zachelrath
    Feb 28, 2018 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .