Cannot connect to the web api

sonarqube

(P.R) #1

Version of SQ: 6.7.2
I am trying to connect and use web api through a JS script on our server.

The piece of code:

    var sslOption = { strictSSL: false};
        var cred="myUser:password";

                var url="https://ourcompany.com/api/metrics";
                HTTP.get(url, { auth :cred,npmRequestOptions: sslOption}, 
                    function( error, response ) {
                   console.log(error,response);
                      });
            } catch (e) {
                if (e.response) {
                    UTILS.error({ message: 'http statusCode=[' + e.response.statusCode + ']: url=[' + options.url + ']', error:e });
                }
            }

The response I get back is error 502. I am inside our intranet and can login to Sonar using web browser easily.

(Julien Lancelot) #2

Hi,

As it’s a 502 error, could you please have a look in the sonar/web.log to see what is the error ?

Regards,
Julien Lancelot