6

I have version 9.0 update 2 and am working with the sample JSS app. I used the this same app on an earlier environment which was setup as Standalone and had no issues. This is a remote deploy to a scaled environment. When I attempt the command -jss deploy items - I get the following error.

Unexpected response from import service: Error: unable to get local issuer certificate

This is the scjssconfig.json file I am currently using.

{
  "sitecore": {
    "instancePath": "C:\\sc9_install\\my-sitecore-jss",
    "apiKey": "{00000000-0000-0000-0000-000000000000}",
    "deploySecret": "",
    "deployUrl": "https://sitecore-scaled/sitecore/api/jss/import",
    "layoutServiceHost": "my-sitecore-jss"
  }
}

2 Answers 2

15

It sounds like the SSL certificate on your remote instance is not trusted. Node does not use Windows' cert store, so if it's a trusted cert there it will not be trusted in the JSS CLI.

You can use the --acceptCertificate [cert thumbprint] parameter to make the CLI trust a specific SSL certificate during deployment. To make this easier, consider placing it as an npm script in your package.json (thus running it something like npm run deploy-items-to-scaled or whatever you named the script)

3
  • 3
    Just in case if @Kam's solution with --acceptCertificate doesn't work, consider switching deployUrl to http from https (may require some Sitecore configuration). "Works on my machine" :)
    – Alex Shyba
    Feb 19, 2019 at 22:13
  • @AlexShyba's Solution works for me! :-) Dec 13, 2019 at 8:39
  • I can confirm this worked for me as well :)
    – Ghanendra
    May 7, 2020 at 7:48
3

I tried with http but could not succeed. Got below error.

Unexpected response from import service:
Status message: Not Found
Body: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IIS 10.0 Detailed Error - 404.0 - Not Found</title>

With https it works along with --acceptCertificate if we pass the parameter like below one

jss deploy app --acceptCertificate 89:17:0D:35:FB:F6:FC:3E:8E:E5:9A:22:CE:6C:83:81:8C:DE:76:DD -c -d

This worked for me with Sitecore XP 9.3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.