# HG changeset patch # User Chris Jones # Date 1378579602 25200 # Node ID cccf2b2fe34d36ed601df2f0e2f660ecd8c5236a # Parent 8342afcffc92fde8d5a4a70caff680d5a0451353 Moved the tls.Config from a package-level variable to a client instance variable. diff -r 8342afcffc92 -r cccf2b2fe34d TODO.txt --- 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. diff -r 8342afcffc92 -r cccf2b2fe34d xmpp/stream.go --- 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. diff -r 8342afcffc92 -r cccf2b2fe34d xmpp/xmpp.go --- 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