1
votes

I am testing d3.js and have a working call to a service, but when I added SSL to service and client, it doesn't work. This is probably due to that the SSL certificate is self signed.

Is there a way in d3.js to have it ignore the SSL error?

Updated 2017-02-28: A request for code, which I excluded since it is no major thing. Below is a simple call, which actually only retrieves a file with json-formated data. But the issue would be same when calling the actual REST service.

d3.json("https://vbgmysql01.local/d3/data2.json", function(error,json) {
        console.log(error);
            data = json.devices;
            render(data);
        });

For this call Chrome (on Windows) gives the following error message

GET https://vbgmysql01.local/d3/data2.json net::ERR_INSECURE_RESPONSE

If I place my webpage on the same server, and first accepts the self signed certificate, then everything will work. But that is obviously not how it will be running when finished.

1
have you tried calling the service out of d3? Is possible that d3 is not getting the right answer. - javier
On Windows using Chrome, I will get the following error message net::ERR_INSECURE_RESPONSE. Using Safari or Chrome on Mac will instead complain on CORS, but the same CORS config without SSL is working. Connecting using POSTMAN to the service works fine. - Nenne
Your question is missing code, how are you calling this service? Is it really a CORS request? Have you seen this question. Is there a way in d3.js to have it ignore the SSL error?, this has nothing to do with d3.js, it's your web-browser that's killing the request. Are you loading the page via HTTP and requesting the service via HTTPS? - Mark

1 Answers

0
votes

This is how I solved it. It is not a nice solution, but on the other hand then I should use a real certificate instead.

Connect to the service with the self-signed service. Accept all browser warnings and continue to the site.

Connect to my webpage (in my case using http).

Now data is retrieved, but might require some CORS magic, if not allready present. Thanks for all input.