package main
import (
"crypto/tls"
"fmt"
"github.com/tlsproxy/pgproxy"
)
func main() {
proxyConfig := &pgproxy.ProxyConfig{
Src: "0.0.0.0:7777",
Dst: "192.168.1.11:5432",
HandleError: func(err error) {
fmt.Printf("%+v", err)
},
HandleRead: func(b []byte, state tls.ConnectionState) error {
return nil
},
HandleWrite: nil,
HandleClientState: func(w tls.ConnectionState) error {
return nil
},
}
tlsConfig := &pgproxy.TlsConfig{
ServerCert: "/ca/server.crt",
ServerKey: "/ca/server.key",
CaCert: "/ca/ca.crt",
}
proxy, err := pgproxy.NewProxy(proxyConfig, tlsConfig)
if err != nil {
panic(err)
}
err = proxy.Listen()
if err != nil {
panic(err)
}
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Offer TLS encryption terminates for PostgreSQL
License
tlsproxy/pgproxy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Offer TLS encryption terminates for PostgreSQL
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published