Moved the tls.Config from a package-level variable to a client instance variable.
authorChris Jones <christian.jones@sri.com>
Sat, 07 Sep 2013 11:46:42 -0700
changeset 129 cccf2b2fe34d
parent 128 8342afcffc92
child 130 da6f37ae3ffe
Moved the tls.Config from a package-level variable to a client instance variable.
TODO.txt
xmpp/stream.go
xmpp/xmpp.go
--- a/TODO.txt	Sat Sep 07 11:19:29 2013 -0700
+++ b/TODO.txt	Sat Sep 07 11:46:42 2013 -0700
@@ -23,6 +23,3 @@
 Put roster and bind into separate packages, if possible.
 
 Eliminate as many uses of Generic as possible.
-
-Don't hard-code TLS auto-accept certificates; instead, make it a
-config file option.
--- a/xmpp/stream.go	Sat Sep 07 11:19:29 2013 -0700
+++ b/xmpp/stream.go	Sat Sep 07 11:46:42 2013 -0700
@@ -341,7 +341,7 @@
 	cl.socketSync.Wait()
 
 	// Negotiate TLS with the server.
-	tls := tls.Client(tcp, &TlsConfig)
+	tls := tls.Client(tcp, &cl.TlsConfig)
 
 	// Make the TLS connection available to the reader, and wait
 	// for it to signal that it's working again.
--- a/xmpp/xmpp.go	Sat Sep 07 11:19:29 2013 -0700
+++ b/xmpp/xmpp.go	Sat Sep 07 11:46:42 2013 -0700
@@ -61,9 +61,6 @@
 	SendFilter Filter
 }
 
-// Allows the user to override the TLS configuration.
-var TlsConfig tls.Config
-
 // The client in a client-server XMPP connection.
 type Client struct {
 	// This client's JID. This will be updated asynchronously by
@@ -94,6 +91,8 @@
 	// StartSession() returns.
 	Features                     *Features
 	sendFilterAdd, recvFilterAdd chan Filter
+	// Allows the user to override the TLS configuration.
+	TlsConfig tls.Config
 }
 
 // Connect to the appropriate server and authenticate as the given JID