Merge pull request #4176 from wanjunlei/https

Support external es that enables HTTPS
This commit is contained in:
KubeSphere CI Bot
2021-08-26 14:26:11 +08:00
committed by GitHub
3 changed files with 21 additions and 0 deletions

View File

@@ -19,9 +19,11 @@ package v5
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"time"
"github.com/elastic/go-elasticsearch/v5"
@@ -46,6 +48,11 @@ func New(address string, basicAuth bool, username, password, index string) (*Ela
Addresses: []string{address},
Username: username,
Password: password,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
},
})
return &Elastic{client: client, index: index}, err

View File

@@ -19,9 +19,11 @@ package v6
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"time"
"github.com/elastic/go-elasticsearch/v6"
@@ -46,6 +48,11 @@ func New(address string, basicAuth bool, username, password, index string) (*Ela
Addresses: []string{address},
Username: username,
Password: password,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
},
})
return &Elastic{Client: client, index: index}, err

View File

@@ -19,9 +19,11 @@ package v7
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"time"
"github.com/elastic/go-elasticsearch/v7"
@@ -46,6 +48,11 @@ func New(address string, basicAuth bool, username, password, index string) (*Ela
Addresses: []string{address},
Username: username,
Password: password,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
},
})
return &Elastic{client: client, index: index}, err