acoustic-content-samples/wchtools-cli

wchtools 1.4.11 - LoginREST.loginError Message when pull

fanlearning opened this issue · 2 comments

Failed to pull wch data down to local file system:

  1. wchtools init
  2. wchtools pull -act
    this is my ".wchtoolsoptions" file:
    {
    "username": "adam.iem@mailinator.com",
    "x-ibm-dx-tenant-base-url": "https://dch-dxcloud.rtp.raleigh.ibm.com/api/245f2c66-8b54-4567-ae39-7de792ed32fb"
    }

this is my wchtools-api.log :
[2017-09-08 15:43:25.147] [ERROR] wchtools 1.4.11 - LoginREST.loginError Message: self signed certificate Request Options: {"uri":"https://dch-dxcloud.rtp.raleigh.ibm.com/api/245f2c66-8b54-4567-ae39-7de792ed32fb/login/v1/basicauth","headers":{"Connection":"keep-alive","User-Agent":"wchtools/1.4.11","x-ibm-dx-tenant-id":null},"auth":{"user":"adam.iem@mailinator.com","pass":"****","sendImmediately":true},"followRedirect":false,"maxAttempts":5,"instanceId":989320,"method":"GET"} Body: undefined Response: {}

contact email:
honghe@au1.ibm.com

Looks like the server you are accessing doesn't have a valid SSL certificate (it's using a self-signed certificate). The node request module won't connect to that server via https, unless you set an environment variable telling it to ignore this problem.

Windows: set NODE_TLS_REJECT_UNAUTHORIZED=0 (before running wchtools)

Mac/Linux: export NODE_TLS_REJECT_UNAUTHORIZED=0 (before running wchtools)

Note, the above info is only for that particular developer test environment and not for the public Watson Content Hub service APIs. Please do "not" use Tom's suggested workaround, for use with the public WCH APIs, as those should always have valid certificates. Allowing invalid certificates when you do not need to can open yourself up to unnecessary security risks.