now-cli login error "unable to get local issuer certificate"

Islam Messaadi
Tera Expert

Hello Guys,

I have tried to login to my PDI, using NOW-CLI tool! but unfortunatly i obstructed by this showen error:

unable to get local issuer certificate

λ now-cli login --host https://xxx-xxx.service-now.com --password xxxxxx
× Connection to 'https://xxx-xxx.service-now.com' failed. Credentials not saved.
unable to get local issuer certificate

 login [host] [method] [username] [password]

Options:
  --help      Show help                                                [boolean]
  --version   Show version number                                      [boolean]
  --host      glide instance url    [string] [default: "https://localhost:8443"]
  --method    authentication method        [choices: "basic"] [default: "basic"]
  --username  basic auth username                    [string] [default: "admin"]
  --password  basic auth password                    [string] [default: "admin"]

find_real_file.png

My development environment detail:

λ node -v
v14.17.2

λ npm -v
6.14.13

λ now-cli --version
Now CLI @19.0.0

λ npm list -g --depth 0
C:\Program Files\nodejs
+-- @servicenow/cli@19.0.0
+-- keytar@7.7.0
`-- npm@6.14.13

npm ERR! peer dep missing: @octokit/core@>=3, required by @octokit/plugin-request-log@1.0.4

---------------------------------------------

1- Global installation folder(C:\Program Files\nodejs) --> accessible for admins/trusted users.

2- I ran the command as an administrator.

 

Any suggestion or ideas would be much appreciated thank you all 🙂

Best regards,

1 ACCEPTED SOLUTION

Hello,

Finally, the solution was to set reject unauthorized TLS to no (windows - CMD command):

 

set NODE_TLS_REJECT_UNAUTHORIZED=0

Hope this will help people who had faced the same issue as me!

Best regards 🙂

View solution in original post

8 REPLIES 8

Hi Islam, thanks a lot, I followed the steps that you suggested and now it works fine!

Maybe I ran the set command not as administrator.

After login I create a project, to complete the npm install command without errors I have to downgrade my node version to 12.x in this way the installation was completed successfully.

Michele

Paolo William C
Kilo Contributor

Same issue on Windows 10 Enterprise

Hi Paolo,

Could you please try to follow exact same steps as in here:

NPM:

  1. set NODE_TLS_REJECT_UNAUTHORIZED=0 (as admin)
  2. npm config set strict-ssl false (as admin)
  3. VC_redist.x64.exe --> install it
  4. python-2.7.amd64 --> install it
  5. npm config set python C:\Python27 (python27 path) (as admin)
  6. npm install --global --production windows-build-tools (as admin)

NowUI Framework:

  1. snc extension add --name ui-component
  2. snc configure profile set
  3. snc ui-component project --name {comp-name} --description {description} --profile {profile} --offline --scope {scope}
  4. npm i
  5. npm audit fix
  6. snc ui-component develop
  7. snc ui-component deploy

Regards,

Islam

LyraH
Tera Contributor

The error code that has been receiving, I found a helpful resource guidance in detail for the error solution from:- https://cheapsslweb.com/blog/fixing-unable-to-get-issuer-cert-locally-error/. You can check it out once.

 

I hope it helps!