Below page has "localhost" hard coded which can cause hostname verification issues in certificates.
portal/modulesportal/modules/api.js
So this should be configurable. For instance it can use the hostname that can be configured in portal/configs/designer.json.