Commit 2f80849f authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update cert conf

parent e7bdc9fd
...@@ -25,13 +25,15 @@ func New(_c *config.Config) (dao *Dao, err error) { ...@@ -25,13 +25,15 @@ func New(_c *config.Config) (dao *Dao, err error) {
c: _c, c: _c,
} }
// dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True", // dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=verify-ca sslrootcert=%s",
// _c.PGSQL.User, _c.PGSQL.Password, _c.PGSQL.Host, _c.PGSQL.Port, _c.PGSQL.Database) dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d",
_c.PGSQL.Host, _c.PGSQL.User, _c.PGSQL.Password, _c.PGSQL.Database, _c.PGSQL.Port,
dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=verify-ca sslrootcert=%s",
_c.PGSQL.Host, _c.PGSQL.User, _c.PGSQL.Password, _c.PGSQL.Database, _c.PGSQL.Port, _c.PGSQL.CertFile,
) )
if _c.PGSQL.CertFile != "" {
dsn = fmt.Sprintf("%s sslmode=require sslrootcert=%s", dsn, _c.PGSQL.CertFile)
}
lgr := logger.Default lgr := logger.Default
if _c.PGSQL.EnableLog { if _c.PGSQL.EnableLog {
lgr = logger.Default.LogMode(logger.Info) lgr = logger.Default.LogMode(logger.Info)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment