Tuesday, May 9, 2017

Ember fastboot works with at http api host but not an https one

Leave a Comment
import DS from 'ember-data';  export default DS.JSONAPIAdapter.extend({   host: 'http://api.theapothecaryshoppe.com',   // host: 'https://api.theapothecaryshoppe.com' }); 

The regular host works, but when I use https I get this error:

Error: The adapter operation was aborted at EmberError.AdapterError (/home/nick/the-apothecary-shoppe/portal-ember/tmp/broccoli_merge_trees-output_path-j1H7NK9S.tmp/fastboot/vendor.js:85927:16) at EmberError.ErrorClass (/home/nick/the-apothecary-shoppe/portal-ember/tmp/broccoli_merge_trees-output_path-j1H7NK9S.tmp/fastboot/vendor.js:85952:24) at ajaxError (/home/nick/the-apothecary-shoppe/portal-ember/tmp/broccoli_merge_trees-output_path-j1H7NK9S.tmp/fastboot/vendor.js:87597:15) at Object.hash.error (/home/nick/the-apothecary-shoppe/portal-ember/tmp/broccoli_merge_trees-output_path-j1H7NK9S.tmp/fastboot/vendor.js:87269:23) at fire (/home/nick/the-apothecary-shoppe/portal-ember/node_modules/jquery-deferred/lib/jquery-callbacks.js:78:30) at Object.fireWith (/home/nick/the-apothecary-shoppe/portal-ember/node_modules/jquery-deferred/lib/jquery-callbacks.js:188:7) at Object.fire [as reject] (/home/nick/the-apothecary-shoppe/portal-ember/node_modules/jquery-deferred/lib/jquery-callbacks.js:195:10) at ClientRequest.onError (/home/nick/the-apothecary-shoppe/portal-ember/node_modules/najax/lib/najax.js:208:9) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketErrorListener (_http_client.js:309:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:188:7) at emitErrorNT (net.js:1281:8) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) 

Any thoughts why? this is seriously befuddling me.

1 Answers

Answers 1

Your issue seems to be related to your SSL configuration and more specifically that the certificate you are using is not correctly validated by the CA.

To be sure that this is the case, you can try setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to 0. This is only temporary and for debugging purposes, you shouldn't use it in production!

If that fixes it, I would recommend looking into your certificate validity. You can now even create one for free using LetsEncrypt and you won't get any CA problem.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment