Skip to content

Commit

Permalink
Fix tls connection options (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
sriccio authored Dec 2, 2023
1 parent d43868a commit 45e8936
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/elasticsearch.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
; username: haraka
; password: nice-long-pass-phrase

; [ssl]
; [tls]
; rejectUnauthorized=false


Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ exports.get_es_hosts = function () {

plugin.clientArgs = { nodes: plugin.cfg.es_hosts };
if (plugin.cfg.auth) plugin.clientArgs.auth = plugin.cfg.auth;
if (plugin.cfg.ssl) plugin.clientArgs.ssl = plugin.cfg.ssl;
if (plugin.cfg.tls) plugin.clientArgs.tls = plugin.cfg.tls;
}

exports.es_connect = function (done) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-plugin-elasticsearch",
"version": "8.0.0",
"version": "8.0.1",
"description": "Haraka plugin that saves logs to Elasticsearch",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions test/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('get_es_hosts', function () {
done();
})

it('applies auth & ssl config to client config', function (done) {
it('applies auth & tls config to client config', function (done) {
console.log(this.plugin.cfg);
this.plugin.config.root_path = path.resolve('test', 'fixtures');
this.plugin.load_es_ini();
Expand All @@ -67,7 +67,7 @@ describe('get_es_hosts', function () {
"https://user:[email protected]:9200",
"http://127.0.0.1:9200"
],
"ssl": {
"tls": {
"rejectUnauthorized": false
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/elasticsearch.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
username=haraka
password=nice-long-pass-phrase

[ssl]
[tls]
rejectUnauthorized=false


Expand Down

0 comments on commit 45e8936

Please sign in to comment.