1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00

http request: reduce log message severity from info to debug for TLS related messages (#4106)

* lower tls related log messages from info to debug level
* remove protcodeExecuteScan related warnings

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
This commit is contained in:
tiloKo
2022-11-10 13:17:21 +01:00
committed by GitHub
parent ad36fe5a30
commit 9e1eecb929

View File

@@ -297,7 +297,7 @@ func (c *Client) initialize() *http.Client {
}
if len(c.trustedCerts) > 0 && !c.useDefaultTransport && !c.transportSkipVerification {
log.Entry().Info("adding certs for tls to trust")
log.Entry().Debug("adding certs for tls to trust")
err := c.configureTLSToTrustCertificates(transport)
if err != nil {
log.Entry().Infof("adding certs for tls config failed : %v, continuing with the existing tsl config", err)
@@ -381,11 +381,6 @@ func handleAuthentication(req *http.Request, username, password, token string) {
if (len(username) > 0 || len(password) > 0) && len(req.Header.Get(authHeaderKey)) == 0 {
req.SetBasicAuth(username, password)
log.Entry().Debug("Using Basic Authentication ****/****\n")
log.Entry().Warning("------------------")
log.Entry().Warning("*** [WARNING] *** : Basic authentication is used, recommended method is API key/token authentication")
log.Entry().Warning("*** [WARNING] *** : Basic authentication will be deprecated in the near future, please use API key/token authentication.")
log.Entry().Warning("*** [WARNING] *** : For more details, please refer to BDBA documentation.")
log.Entry().Warning("------------------\n")
}
if len(token) > 0 && len(req.Header.Get(authHeaderKey)) == 0 {
req.Header.Add(authHeaderKey, token)
@@ -616,7 +611,7 @@ func (c *Client) configureTLSToTrustCertificates(transport *TransportWrapper) er
return errors.Wrapf(err, "Download of TLS certificate %v failed with status code %v", certificate, response.StatusCode)
}
} else {
log.Entry().Infof("existing certificate file %v found, appending it to rootCA", target)
log.Entry().Debugf("existing certificate file %v found, appending it to rootCA", target)
certs, err := ioutil.ReadFile(target)
if err != nil {
return errors.Wrapf(err, "failed to read cert file %v", certificate)
@@ -626,7 +621,7 @@ func (c *Client) configureTLSToTrustCertificates(transport *TransportWrapper) er
if !ok {
return errors.Errorf("failed to append %v to root CA store", certificate)
}
log.Entry().Infof("%v appended to root CA successfully", certificate)
log.Entry().Debugf("%v appended to root CA successfully", certificate)
}
}