Site: SSL exception


I enabled SSL for one of our 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() {
        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" >

Test case

It works fine without HTTPS:

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


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


It has a very simple Solution.

For the site 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.


Source : Link , Question Author : Christian Deckert , Answer Author : Ashwani

Leave a Comment