Skip to content

Commit

Permalink
Merge pull request #2 from ObolNetwork/add-tls
Browse files Browse the repository at this point in the history
Add tlsconfig to drivers
  • Loading branch information
LukeHackett12 authored May 2, 2024
2 parents 5652bfb + 9d2031f commit 9a0f995
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 4 additions & 5 deletions pkg/db/high_level_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package db

import (
"context"


"crypto/tls"
"fmt"
"net"
"strings"
Expand Down Expand Up @@ -55,10 +56,8 @@ func ParseChUrlIntoOptionsHighLevel(url string) clickhouse.Options {
Username: user,
Password: password,
},
DialContext: func(ctx context.Context, addr string) (net.Conn, error) {
dialCount++
var d net.Dialer
return d.DialContext(ctx, "tcp", addr)
TLS: tls.Config{
InsecureSkipVerify: false,
},
Debug: false,
Debugf: func(format string, v ...any) {
Expand Down
7 changes: 6 additions & 1 deletion pkg/db/low_level_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package db

import (
"context"
"crypto/tls"
"strings"
"time"

Expand Down Expand Up @@ -51,7 +52,11 @@ func ParseChUrlIntoOptionsLowLevel(url string) ch.Options {
Address: fqdn,
Database: database,
User: user,
Password: password}
Password: password,
DialTimeout: time.Second * 30,
TLS: &tls.Config{
InsecureSkipVerify: false,
}}
}

func (p *DBService) Persist(
Expand Down

0 comments on commit 9a0f995

Please sign in to comment.