My json file was formatted particularly as the a person from the problem but Not one of the answers listed here worked out. Last but not least I discovered a workaround on A further Stackoverflow thread."unable to validate the main certification" when connecting to elasticsearch from nodejs making use of self-generated certificates See more joined