AnsweredAssumed Answered

How to use SSL Labs' API into a web browser (from javascript)

Question asked by Samuel Emangard on Jan 16, 2017
Latest reply on Jan 17, 2017 by Rob Moss



I haven't been able to call SSL Labs' API from javascript into a browser

the HTTP response code is 403 forbidden for the URL :[ssl_host] 


If I copy-paste this URL into a browser's tab and then it works as if a security control avoids to call the API from another web page.


How to proceed ?


Here is my peace of code :


    function qualysScan(site) {
            var API_URL = '' + site.ssl_host;
            var successCallback = function(data, textStatus, jqXHR) {
                switch(data.status) {
                    case 'READY':
                        site.set('qualysscandetails', data);
                    case 'IN_PROGRESS':
                        // We only need one endpoint to complete
                        if (_.has(data.endpoints[0], 'grade')) {
                            site.set('qualysscandetails', data);
                        } else {
                            setTimeout( function(site){
                            }, 5000, site );// 5 seconds


                    case 'DNS':
                        setTimeout( function(site){
                            }, 3000, site );// 3 seconds
                 url: API_URL
                ,method: 'GET'
                ,success: successCallback