{"action":"opened","issue":{"url":"https://api.github.com/repos/mattn/go-xmpp/issues/66","labels_url":"https://api.github.com/repos/mattn/go-xmpp/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/mattn/go-xmpp/issues/66/comments","events_url":"https://api.github.com/repos/mattn/go-xmpp/issues/66/events","html_url":"https://github.com/mattn/go-xmpp/issues/66","id":128909824,"number":66,"title":"works without TLS: NoTLS: true, and StartTLS: false","user":{"login":"ik-","id":10967586,"avatar_url":"https://avatars.githubusercontent.com/u/10967586?v=3","gravatar_id":"","url":"https://api.github.com/users/ik-","html_url":"https://github.com/ik-","followers_url":"https://api.github.com/users/ik-/followers","following_url":"https://api.github.com/users/ik-/following{/other_user}","gists_url":"https://api.github.com/users/ik-/gists{/gist_id}","starred_url":"https://api.github.com/users/ik-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ik-/subscriptions","organizations_url":"https://api.github.com/users/ik-/orgs","repos_url":"https://api.github.com/users/ik-/repos","events_url":"https://api.github.com/users/ik-/events{/privacy}","received_events_url":"https://api.github.com/users/ik-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-26T18:54:05Z","updated_at":"2016-01-26T18:54:05Z","closed_at":null,"body":"IMHO here bug in switch, should be:\r\nfunc (c *Client) startTLSIfRequired(f *streamFeatures, o *Options, domain string) (*streamFeatures, error) {\r\n\r\n\tswitch {\r\n\r\n\tcase f.StartTLS == nil:\r\n\t\t// the server does not support STARTTLS\r\n\t\treturn f, nil\r\n\tcase f.StartTLS.Required != nil: // the server requires STARTTLS.\r\n\tcase o.StartTLS:\r\n\t\tbreak // the user wants STARTTLS and the server supports it.\r\n\tdefault:\r\n\t\treturn f, nil\r\n\t}\r\n......."}}