xmpp/dial d---------
dial: simplify dialing and update docs

This patch updates the docs to better show the state of dialing as it
currently stands, and simplifies the dialing algorithm by factoring out
legacy A/AAAA fallback and reworking how the TLS config is handled.

Signed-off-by: Sam Whited <sam@samwhited.com>
dial: retry DNS integration tests up to 3 times

These are probably our most flaky integration tests. Retry them up to 3
times to try and reduce the flake to acceptable levels.

Signed-off-by: Sam Whited <sam@samwhited.com>
all: update build tags for Go 1.17

See: https://golang.org/issues/41184

Signed-off-by: Sam Whited <sam@samwhited.com>
all: update default TLS config to use TLS >= 1.2

Signed-off-by: Sam Whited <sam@samwhited.com>
dial: remove unused function

Signed-off-by: Sam Whited <sam@samwhited.com>
dial: fix fallback when one service returns "."

Previously if one service (eg. xmpp-client) returned "." and the other
(xmpps-client) did not, we wouldn't fall back and instead would return
an error. This patch fixes that to always use whichever service is not
explicitly set to ".". It also adds several integration tests against
the bad configurations at badxmpp.eu.

Signed-off-by: Sam Whited <sam@samwhited.com>
dial: refactor dialing

Previously dialing required xmpps SRV records if SRV lookup and direct
TLS are enabled.
Refactoring the dialing will allow us to connect to whichever record is
enabled (if any) and gives us the added benefit of doing the DNS lookups

Fixes #2

Signed-off-by: Sam Whited <sam@samwhited.com>
all: add missing canonical import comments

Signed-off-by: Sam Whited <sam@samwhited.com>
dial: remove all tests

The dial tests are passing on FreeBSD, but sometimes blocking forever on
Linux, not to mention they're very slow. Until I can figure out a better
way to handle the DNS resolution tests, remove them alltogether.
dial: wait for testing DNS server to shut down

The append is sometimes happening after the tests have completed,
resulting in a failure. Wait until the DNS server goroutine shuts down
to check the test results.
dial: fix flaky test

Previous a request might be made for A or AAAA records depending on what
networks were available. We don't care which is used, so normalize all
requests that we record to AAAA which was already being used in the
dial: check DNS questions in tests
dial: fix broken tests
dial: use port if provided in JID
dial: fallback to domainpart, not full JID
xmpp, dial: split dialer out into own package