summaryrefslogtreecommitdiff
path: root/vendor/src/github.com/spacemonkeygo/openssl/net.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/src/github.com/spacemonkeygo/openssl/net.go')
-rw-r--r--vendor/src/github.com/spacemonkeygo/openssl/net.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/src/github.com/spacemonkeygo/openssl/net.go b/vendor/src/github.com/spacemonkeygo/openssl/net.go
index 275f5c27b97..3cdd040d4d4 100644
--- a/vendor/src/github.com/spacemonkeygo/openssl/net.go
+++ b/vendor/src/github.com/spacemonkeygo/openssl/net.go
@@ -77,6 +77,25 @@ const (
// This library is not nice enough to use the system certificate store by
// default for you yet.
func Dial(network, addr string, ctx *Ctx, flags DialFlags) (*Conn, error) {
+ return DialSession(network, addr, ctx, flags, nil)
+}
+
+// DialSession will connect to network/address and then wrap the corresponding
+// underlying connection with an OpenSSL client connection using context ctx.
+// If flags includes InsecureSkipHostVerification, the server certificate's
+// hostname will not be checked to match the hostname in addr. Otherwise, flags
+// should be 0.
+//
+// Dial probably won't work for you unless you set a verify location or add
+// some certs to the certificate store of the client context you're using.
+// This library is not nice enough to use the system certificate store by
+// default for you yet.
+//
+// If session is not nil it will be used to resume the tls state. The session
+// can be retrieved from the GetSession method on the Conn.
+func DialSession(network, addr string, ctx *Ctx, flags DialFlags,
+ session []byte) (*Conn, error) {
+
host, _, err := net.SplitHostPort(addr)
if err != nil {
return nil, err