require ssl mode
This commit is contained in:
parent
ff36b182d1
commit
90d4a467cf
|
|
@ -18,7 +18,7 @@ type infraManager struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (im *infraManager) openConn() error {
|
func (im *infraManager) openConn() error {
|
||||||
dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s sslmode=disable TimeZone=Asia/Shanghai",
|
dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s sslmode=require TimeZone=Asia/Shanghai",
|
||||||
im.cfg.DBHost, im.cfg.DBUser, im.cfg.DBPass, im.cfg.DBName, im.cfg.DBPort)
|
im.cfg.DBHost, im.cfg.DBUser, im.cfg.DBPass, im.cfg.DBName, im.cfg.DBPort)
|
||||||
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
|
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue