sipcapture / heplify-server

HEP Capture Server for HOMER
https://sipcapture.org
GNU Affero General Public License v3.0
186 stars 89 forks source link

PgSQL SSL and PgSQL dsn hostname. #437

Open volga629-1 opened 4 years ago

volga629-1 commented 4 years ago

Hello Everyone, I need assistant with following issues.

1 PgSQL driver set to sslmode=disable is possible it make configurable with values according postgres ssl client.

In database/database.go

 dsn = "sslmode=disable connect_timeout=4" +
                        " host=" + addr[0] +
                        " port=" + addr[1] +
                        " dbname=" + dbName +
                        " user=" + config.Setting.DBUser +
                        " password=" + config.Setting.DBPass

2 FQDN is correct form in database connection in dsn, but connection is rejected . In database/database.go

func ConnectString(dbName string) (string, error) {
        var dsn string
        driver := config.Setting.DBDriver
        addr := strings.Split(config.Setting.DBAddr, ":")
        if len(addr) != 2 {
                return "", fmt.Errorf("wrong database connection format: %v, it should be localhost:3306", config.Setting.DBAddr)
        }
  1. Rotator.go is not follow config file for database connection start.
Oct 06 02:23:17 voice-diag /usr/bin/heplify-server[64948]: rotator.go:352: dial tcp [::1]:5432: connect: connection refused
Oct 06 02:23:17 voice-diag /usr/bin/heplify-server[64948]: rotator.go:355: dial tcp [::1]:5432: connect: connection refused
nathanleyton commented 4 years ago

+1 on this, our db requires ssl which is preventing us form using homer atm. Thanks