Skip to content

Commit

Permalink
feat: remove insecureskipverify for opensearch and fix spelling
Browse files Browse the repository at this point in the history
Co-authored-by: Vegar Sechmann Molvig <[email protected]>
  • Loading branch information
Muni10 and sechmann committed Jan 26, 2024
1 parent 838c4ef commit 674a524
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/contests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"context"
"crypto/tls"
_ "crypto/tls"
"fmt"
"github.com/nais/contests/internal/opensearch"
Expand Down Expand Up @@ -87,7 +86,7 @@ func main() {
if bigQueryDatasetName != "" && bigQueryProjectID != "" {
bqClient, err := bq.NewClient(ctx, bigQueryProjectID)
if err != nil {
log.Errorf("Detected BigQuery contiguration, but failed to set up client: %v", err)
log.Errorf("Detected BigQuery configuration, but failed to set up client: %v", err)
} else {
log.Infof("Detected BigQuery configuration, setting up handler for %v in project %v", bigQueryDatasetName, bigQueryProjectID)
dataset := bqClient.Dataset(bigQueryDatasetName)
Expand All @@ -99,15 +98,12 @@ func main() {

if opensearchUri != "" && opensearchUser != "" && opensearchPassword != "" {
client, err := osgo.NewClient(osgo.Config{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
Addresses: []string{opensearchUri},
Username: opensearchUser,
Password: opensearchPassword,
})
if err != nil {
log.Errorf("Detected opensearch contiguration, but failed to set up client: %v", err)
log.Errorf("Detected opensearch configuration, but failed to set up client: %v", err)
} else {
log.Info("Detected opensearch configuration, setting up handler")
http.HandleFunc("/opensearch", opensearch.Handler(ctx, client))
Expand Down

0 comments on commit 674a524

Please sign in to comment.