Previously, the function checked only for a single CA root cert, however
some distributions may have multiple certs in a directory. This will now
try any .crt or .pem file contained within several common paths for
each platform.
Fixes#6412
self.module.fail_json(msg='failed to validate the SSL certificate for %s:%s. You can use validate_certs=no, however this is unsafe and not recommended'%(self.hostname,self.port))
# try the next one
pass
# fail if we tried all of the certs but none worked
self.module.fail_json(msg='Failed to validate the SSL certificate for %s:%s. '%(self.hostname,self.port)+ \
'Use validate_certs=no or make sure your managed systems have a valid CA certificate installed. '+ \
'Paths checked for this platform: %s'%", ".join(paths_checked))
# if no CA certs were found, we just fall through
# to here and return the request with no SSL validation