<commit_before>*<expletive>*  

http://domains.google.com/checkip doesn't work as of February for IPv4 addresses from Python, which is unfortunately, given in a previous life I personally wrote the Google server side code with an eye towards writing a python client.

The server code is fine, per se.  But:

* Google now redirects all unencrypted (http) connections to secure (https) ones
* Google is IPv6 enabled 
* Dynamic DNS checking is for IPv4 (IPv6 doesn't need it)
* Python's various libraries like urllib2 don't allow forcing IPv4 except by:
  a) replacing the host name in URL with the IP address
  b) adding a "Host: domains.google.com" header by hand
* Python checks the host in the URL (not the Host header) against the SSL cert returned by the server.

So the Python IPv4 workaround doesn't work when https is forced by Google because the IP address doesn't match the SSL certificate.

A temporary work around is to use http://checkip.kew.com, which is a prototype of the same functionality. It was implemented in Python on Google App Engine, which doesn't force the redirect to SSL.  This is safe, but insecure.

Another work around is rather than calling urllib2, use python's lower level urlparse and httplib modules; these used in tandem support basic HTTP over IPv4 SSL connections, but don't automatically handle redirect or authentication.
<commit_msg>Update text for python vs. Google IPv6 bug<commit_after><expletive>

http://domains.google.com/checkip doesn't "just work" as of February
2016 for IPv4 addresses from Python, which is unfortunate, given
in a previous life I personally wrote the Google server side code
with an eye towards writing a python client.

The server code is fine, per se.  But a combination of factors are
at work:

* Google now redirects all unencrypted (http) request to secure
  (https) URLs.
* Google is IPv6 enabled, and it's not easily disabled for other
  than www.google.com.  (ipv4.google.com is an IPv4-only alias of
  www.google.com itself).
* Dynamic DNS checking is strictly for IPv4 (IPv6 doesn't need it).
* Python's high level libraries like urllib2 don't allow forcing
  IPv4 except by:
  a) replacing the host name in URL with the IP address -and-
  b) manually adding a "Host: domains.google.com" header.
* Python checks the host in the URL (not the Host header) against
  the SSL cert returned by the server.

So the Python IPv4 workaround doesn't work when https is forced by
Google because the IP address doesn't match the SSL certificate.

A temporary work around is to use http://checkip.kew.com, which is
a prototype of the same functionality. It was implemented in Python
on Google App Engine, which doesn't force the redirect to SSL.  This
is safe (as in unlikely to break), but insecure.

Another work around is rather than calling urllib2, use python's
lower level urlparse and httplib modules; when used in tandem, these
support HTTP or HTTPS, although they don't automatically handle redirect
or authentication.

{'fraction_non_alphanumeric': 0.051470588235294115, 'fraction_numerical': 0.008021390374331552, 'mean_word_length': 4.316163410301954, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6296065', 'n_tokens_mistral': 812, 'n_tokens_neox': 763, 'n_words': 461}