Skip to content

Commit

Permalink
added support for TLS
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Jackson committed Aug 30, 2024
1 parent 5347de1 commit 182de6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package database

import (
"context"
"crypto/tls"
"github.com/wizedkyle/artifactsmmo/v2/internal/utils"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
Expand Down Expand Up @@ -32,8 +33,7 @@ func Init() {
if os.Getenv("GIN_MODE") == "" {
opts = options.Client().ApplyURI("mongodb://mongodb:27017")
} else {

opts = options.Client().ApplyURI("")
opts = options.Client().ApplyURI(os.Getenv("CONNECTION_STRING")).SetTLSConfig(&tls.Config{})
}
client, err := mongo.Connect(context.TODO(), opts)
if err != nil {
Expand Down

0 comments on commit 182de6f

Please sign in to comment.