Skip to content

Commit

Permalink
Remove ca cert path for cloud testing (#73317)
Browse files Browse the repository at this point in the history
  • Loading branch information
liza-mae authored Jul 27, 2020
1 parent 2ae470e commit 88aebc9
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions test/common/services/elasticsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@ import { FtrProviderContext } from '../ftr_provider_context';
export function ElasticsearchProvider({ getService }: FtrProviderContext) {
const config = getService('config');

return new Client({
ssl: {
ca: fs.readFileSync(CA_CERT_PATH, 'utf-8'),
},
nodes: [formatUrl(config.get('servers.elasticsearch'))],
requestTimeout: config.get('timeouts.esRequestTimeout'),
});
if (process.env.TEST_CLOUD) {
return new Client({
nodes: [formatUrl(config.get('servers.elasticsearch'))],
requestTimeout: config.get('timeouts.esRequestTimeout'),
});
} else {
return new Client({
ssl: {
ca: fs.readFileSync(CA_CERT_PATH, 'utf-8'),
},
nodes: [formatUrl(config.get('servers.elasticsearch'))],
requestTimeout: config.get('timeouts.esRequestTimeout'),
});
}
}

0 comments on commit 88aebc9

Please sign in to comment.