When a Salesforce Sandbox is refreshed from Production, the CustomSite metadata copied to the sandbox contains a reference to the production domain but is missing the <certificate> element. When this incomplete CustomSite metadata is later deployed to any environment (sandbox or production), Salesforce changes the domain's HTTPS option from 'Salesforce Cloud' to 'No HTTPS (Temporary)'.
The incomplete metadata element looks like this (notice the missing <certificate> element):<customWebAddresses> <domainName>your-custom-domain</domainName> <primary>true</primary> </customWebAddresses>
A complete metadata element with the certificate element included would look like:<customWebAddresses> <certificate>certificate-unique-name</certificate> <domainName>www.testing123.com</domainName> <primary>true</primary> </customWebAddresses>
Use one of the following options to prevent or recover from this issue.
Domain metadata in lower environments are copies of the production domain configuration. They exist only because the sandbox was refreshed from production.
If the CustomSite metadata does not contain any changes that need to be deployed, remove it from your deployment package entirely. After deployment, correct the domain HTTPS option to the intended setting as a post-deployment step.
If you must deploy the CustomSite metadata, add the <certificate> element to the <customWebAddresses> block in your deployment package before deploying:
Add the <certificate> element with the certificate unique name, the <domainName> element with your custom domain, and <primary>true</primary> within the <customWebAddresses> block.
Then deploy the updated metadata to your affected sandbox.
Important: The certificate used for the domain must match the Common Name (CN) or Subject Alternative Names (SANs) of the Production certificate. Self-signed certificates will not work. To obtain a valid certificate, either refresh the sandbox from Production to receive a copy of the Production certificates, or import the original JKS certificate.
000396704

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.