staging-realm-customer.demandware.net)
cert.staging.realm.customer.demandware.net hostname will be deactivatedcert.staging hostname; after the migration, use new Client Certificates with the standard BM hostname.Run the following openssl command, replacing <realm> and <customer>:
$ CERT_HOST=staging-<realm>-<customer>.demandware.net
$ openssl req -new -newkey rsa:2048 -sha256 -days 365 -x509 -nodes -keyout ${CERT_HOST}.key -out ${CERT_HOST}.crt
Fill out the prompts as appropriate, for Common Name use the same value used for CERT_HOST. See example below:
$ openssl req -new -newkey rsa:2048 -sha256 -days 365 -x509 -nodes -keyout ${CERT_HOST}.key -out ${CERT_HOST}.crt
.....+............+.........+++++++++++++++++++++++++++++++++++++++*.......+..+......+.+........+..........+............+...+..+.+++++++++++++++++++++++++++++++++++++++*.+...............+.+..+......+....+.....+..................+...+......+....+......+.....+......+....+..................+..+...+.......+.....+.+..+.......+..................+......+..........................+...+.............+..+.......+.....+.+........+......+.+..+...+.......+..+.+.....+...+....++++++
..+++++++++++++++++++++++++++++++++++++++*.+.....+..........+...+..+....+..+............+.+++++++++++++++++++++++++++++++++++++++*.....+.......+...+.....................+..+...+.+...+..+....+.....+.....................+.........+..........+.........+..+.+..+.+..+.......+.....+.+.....+.........+.+.....+...............+.......+..+.+.....+.+...........+...+.+.........+.....+......+.+............+......+............+..+.............+.......................+.+...+..+...+.......+...+........+...+.........+...+....+...+.....+......+.......+.....+.......+..................+...............+........+....+...+..............+.+..+...+...............+....+.........+.........+......+...........+.+..+...+..................+....+..+.+.....+...+................+........+................+.....+.+...+...+...+.....+......+...+.+.........+..+......++++++
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:MA
Locality Name (eg, city) []:Burlington
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Salesforce
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:cert.staging.realm.customer.demandware.net
Email Address []:
The CA certificate and private will next need to be uploaded to eCDN. This can be done via the BM UI, or using the CDN-API
Once this is complete, eCDN will be configured to accept client certificates signed by this CA cert.
In Business Manager for the Staging instance, navigate to Administration → Site Development → Development Setup → Code Upload Certificate (tab)
On this page, select Add Certificate, enter a Certificate Name (for ease of organization), and copy/paste the Certificate and Private Key data generated above, then Save
(Optional) Delete unused/expired CA certs
Multiple CA certs may be active at a time. If there are any unused, expired, or compromised CA certs, they can also be removed via this screen.
Before uploading via CDN-API, the crt and key files need to be, formatted to what CDN-API expects them to be in. The contents of the crt and key files above will need literal newlines replaced with \n. This output will be used in the following step:
Below is a reference command that can be used for this
$ cat ${CERT_HOST}.crt | perl -pe 's/\n/\\n/g'
$ cat ${CERT_HOST}.key | perl -pe 's/\n/\\n/g'
You can also use a text editor with advanced Regular Expression support, such as Sublime, to do this by using find and replace. With Sublime:
.crt fileFind → Replace....* button)\n\\n.key file
Uploading the CA certificate
With these files now in the expected format, upload the cert to eCDN using CDN-API:
Reference curl command to obtain access token to call CDN API
curl "https://account.demandware.com/dwsso/oauth2/access_token" \
--request 'POST' \
--user "<api_client_id>:<client_secret>" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data "grant_type=client_credentials" \
--data-urlencode "scope=SALESFORCE_COMMERCE_API:<realm>_stg sfcc.cdn-zones.rw"
Reference curl command for CDN-API call to upload the certificate (Note: certificate and privateKey values are based of formatted values obtained in previous step)
curl --location 'https://<shortcode>.api.commercecloud.salesforce.com/cdn/zones/v1/organizations/f_ecom_<realmid>_stg/mtls/code-upload-certificates' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer abcd*****' \
--data '{
"name": "client ca for code upload",
"certificate": "-----BEGIN CERTIFICATE----- \ncacertificatestring\n -----END CERTIFICATE-----",
"privateKey": "-----BEGIN PRIVATE KEY-----\nprivatekeystring\n -----END PRIVATE KEY-----"
}'
Reference curl command for CDN-API call to get code upload certificates, used to check existing certificates
curl --location 'https://<shortcode>.api.commercecloud.salesforce.com/cdn/zones/v1/organizations/f_ecom_<realmid>_stg/mtls/code-upload-certificates' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer abcd*****'
Reference curl command for CDN-API call to delete existing code upload certificates (if expired, unused, or compromised) using the mtlsCertificateId obtained via the get call
curl --location 'https://<shortcode>.api.commercecloud.salesforce.com/cdn/zones/v1/organizations/f_ecom_<realmid>_stg/mtls/code-upload-certificates/{mtlsCertificateId}' \
-X DELETE
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer abcd*****'
(Note: certificate and privateKey values are based of formatted values obtained in previous step) You can find your Shortcode by logging into your staging instance and navigating to Administration> Site Development > Salesforce Commerce API Settings
mail
roles
tenantFilter
profile
openId
sfcc.cdn-zones
sfcc.cdn-zones.rw
Client Certificates should be generated per user, but can be signed with the same CA cert
For each user complete the following steps:
USER should be the BM username; challenge password and optional company name should be omitted):
-legacy flag needed for newer versions of openssl to import to Mac keychain), the export password needs to be configured and shared with the user of the client cert:
${USER}.p12 file can now be used with UX Studio and WebDAV clients like CyberDuckThe CA certificate bundle is allowed a maximum expiry of 1 year. Before it expires it will need to be renewed in order to avoid disruption with code uploads. This procedure should also be followed if the security of the CA certificate or any client certificate that it has signed has been compromised
To renew the cert, follow the instructions above to generate and upload a new certificate. Multiple CA certificate bundles can be active at the same time to allow for overlap during renewals. New client certificates will also need to be generated and signed by this new bundle to work properly
Once the client certificates have been replaced and validated as working, the previous CA certificate bundle should be removed. This can be done via BM on the same page as where the bundle was originally uploaded, or it can be removed using the CDN-API delete code upload certificate endpoint
002772125

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.