Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion connection.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gorethink

import (
"crypto/tls"
"encoding/binary"
"encoding/json"
"io"
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gorethink

import (
"crypto/tls"
"time"

p "github.com/dancannon/gorethink/ql2"
Expand All @@ -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"`
Expand Down