diff --git a/CHANGELOG.md b/CHANGELOG.md index f308ad3e..208cdc23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ For more details checkout the [README](https://github.com/dancannon/gorethink/bl - Changed driver to use the v0.4 protocol (used to use v0.3). - Fixed geometry tests not properly checking the expected results. - Fixed bug causing nil pointer panics when using an `Unmarshaler` +- Fixed dropped millisecond precision if given value is too old ## v0.6.3 - 2015-03-04 ### Added diff --git a/connection.go b/connection.go index b95df74e..ee547afa 100644 --- a/connection.go +++ b/connection.go @@ -1,6 +1,7 @@ package gorethink import ( + "crypto/tls" "encoding/binary" "encoding/json" "io" @@ -49,7 +50,11 @@ func NewConnection(address string, opts *ConnectOpts) (*Connection, error) { } // Connect to Server nd := net.Dialer{Timeout: c.opts.Timeout} - c.conn, err = nd.Dial("tcp", address) + if c.opts.TLSConfig == nil { + c.conn, err = nd.Dial("tcp", address) + } else { + c.conn, err = tls.DialWithDialer(&nd, "tcp", address, c.opts.TLSConfig) + } if err != nil { return nil, err } diff --git a/session.go b/session.go index 72f5771b..c4e59434 100644 --- a/session.go +++ b/session.go @@ -1,6 +1,7 @@ package gorethink import ( + "crypto/tls" "time" p "github.com/dancannon/gorethink/ql2" @@ -22,6 +23,7 @@ type ConnectOpts struct { Database string `gorethink:"database,omitempty"` AuthKey string `gorethink:"authkey,omitempty"` Timeout time.Duration `gorethink:"timeout,omitempty"` + TLSConfig *tls.Config `gorethink:"tlsconfig,omitempty"` MaxIdle int `gorethink:"max_idle,omitempty"` MaxOpen int `gorethink:"max_open,omitempty"`