laurolins / nanocube

Eclipse Public License 1.0
734 stars 162 forks source link

Running over HTTPS #47

Open markwynter opened 8 years ago

markwynter commented 8 years ago

Hi there! We're wanting to deploy nanocubes through iframe in web portal(s) - we've implement a replace rule on application nginx server http://" and "https://" to just "//" (so protocol independent URL) - but this doesn't appear sufficient as nanocube server side JavaScript is making http requests which breaks if front end portal is https. Equally if we hard code https URLs in the nanocube backend, we can't support portals running over http. Is there a protocol independent solution we can implement on nanocube server side? Any guidance would be most appreciated. Kind regards, Mark

markwynter commented 8 years ago

Just to clarify, the issue is with nc_web_viewer, and our requirement is to make the nanocube application server protocol agnostic so we can embed the nc_web_viewer in iframes that may be served independently over http or https.

laurolins commented 8 years ago

Nanocube uses the Mongoose Embedded Web Server Library for its web communication infra structure. The master branch version of the nanocube server allows you to pass an SSL certificate file .pem with the option --sslfile <pem-file> which triggers the mongoose option "ssl_certificate". Here is the code for that on line 160 of src/Server.cc mg_set_option(srv, "ssl_certificate", pemfile.c_str());

Here is the template of the call: nanocube-leaf -q <query-port> --sslfile <ssl-certificate> < <dataset-file>

markwynter commented 8 years ago

Thanks Lauro - we're still grappling with this - I've asked my developers to clearly layout the issue, which I'll share with you shortly.