IDNAError when trying to GET a working url

Getting some URLs cause an IDNAError, but they work just fine with curl and other url fetchers.

## Expected Result

A successful request

## Actual Result

    idna.core.IDNAError: The label b'xn--mn8ha4uc' is not a valid A-label
    The label b'xn--mn8ha4uc' is not a valid A-label

## Reproduction Steps

```python
import requests

requests.get('https://thegroovecartel.com/feed/')
```

## System Information

    $ python -m requests.help

```
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": "2.2.2"
  },
  "idna": {
    "version": "2.6"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.6.4"
  },
  "platform": {
    "release": "4.15.12-201.fc26.x86_64",
    "system": "Linux"
  },
  "pyOpenSSL": {
    "openssl_version": "1010008f",
    "version": "17.5.0"
  },
  "requests": {
    "version": "2.18.4"
  },
  "system_ssl": {
    "version": "1010007f"
  },
  "urllib3": {
    "version": "1.22"
  },
  "using_pyopenssl": true
}

```

```
>>> import requests
>>> 
>>> requests.get('https://thegroovecartel.com/feed/')
<Response [200]>
>>> import requests.help
>>> requests.help.main()
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "2.6"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.6.4"
  },
  "platform": {
    "release": "4.15.7-300.fc27.x86_64",
    "system": "Linux"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.18.4"
  },
  "system_ssl": {
    "version": "1010007f"
  },
  "urllib3": {
    "version": "1.22"
  },
  "using_pyopenssl": false
}
```

I can't reproduce this.

Ah, the "it works for me" rebuttal. How original.
If I had to guess, I'd say the issue is with pyopenssl.

I was able to reproduce this by installing `requests[security]`. It looks like the certificate has many subjectAltNames, one of which is `xn-mn8ha4uc.ws` (Literally 👉 👈.ws in punycode).

@erezsh, this isn't reproduceable with the steps you provided. The exception seems to only occur in due to the emoji modifiers being outside of the expected byte range:

python 2:
```python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user/.pyenv/versions/2.7.13/lib/python2.7/site-packages/idna-2.6-py2.7.egg/idna/core.py", line 302, in ulabel
  File "/Users/user/.pyenv/versions/2.7.13/lib/python2.7/encodings/punycode.py", line 208, in decode
    res = punycode_decode(input, errors)
  File "/Users/user/.pyenv/versions/2.7.13/lib/python2.7/encodings/punycode.py", line 195, in punycode_decode
    return insertion_sort(base, extended, errors)
  File "/Users/user/.pyenv/versions/2.7.13/lib/python2.7/encodings/punycode.py", line 180, in insertion_sort
    base = base[:pos] + unichr(char) + base[pos:]
ValueError: unichr() arg not in range(0x10000) (narrow Python build)
```
python 3:

```python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user/.pyenv/versions/3.4.7/lib/python3.4/site-packages/idna-2.6-py3.4.egg/idna/core.py", line 303, in ulabel
  File "/Users/user/.pyenv/versions/3.4.7/lib/python3.4/site-packages/idna-2.6-py3.4.egg/idna/core.py", line 253, in check_label
idna.core.InvalidCodepoint: Codepoint U+1F449 at position 1 of '👉\U0001f3fb👈\U0001f3fb' not allowed
````

This is at the very least an issue for IDNA, but more likely a lack of support at the standard lib level. Sigmavirus24 is right to close this though because Requests can't do anything at this point due to lack of support in underlying libraries. I'd suggest opening a followup issue with the [idna library](https://github.com/kjd/idna) and see where they think the issue lies.

@SethMichaelLarson @nateprewitt  Thanks for the detailed response.

I'm getting a different exception, but I'm guessing it's for the same reason.

Perhaps relying on IDNA is not the best choice for requests, since it looks like it can work without it? 

Anyway, it's not my place to say. I just wanted to bring this to your attention.

FYI I got the same exception as you on Python 3.6.4 in addition to @nateprewitt's exception:
`idna.core.InvalidCodepoint: Codepoint U+1F449 at position 1 of '👉🏻👈🏻' not allowed`
`idna.core.IDNAError: The label b'xn--mn8ha4uc' is not a valid A-label`

> Perhaps relying on IDNA is not the best choice for requests, since it looks like it can work without it?

@erezsh that's not accurate.

> Anyway, it's not my place to say. I just wanted to bring this to your attention.

Please do bring it to the attention of [idna](/kjd/idna).

Emojis are not valid in domain names... Really this is pyopenssl's fault, it should squash the error since it isn't relevant (invalid subjectAltName that doesn't match the domain we're fetching anyway).

Filed at pyopenssl, who say it's not their bug to fix: https://github.com/pyca/pyopenssl/issues/771

Current reproducer, with two exceptions generated:

```
>>> import requests
>>> requests.__version__
>>> requests.get("https://earthlingsoft.net/UnicodeChecker/appcast.xml")
Traceback (most recent call last):
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py", line 271, in alabel
    ulabel(label)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py", line 311, in ulabel
    check_label(label)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py", line 261, in check_label
    raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+2603 at position 1 of '☃' not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/connection.py", line 367, in connect
    cert = self.sock.getpeercert()
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 351, in getpeercert
    'subjectAltName': get_subj_alt_name(x509)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 228, in get_subj_alt_name
    for name in ext.get_values_for_type(x509.DNSName)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 228, in <listcomp>
    for name in ext.get_values_for_type(x509.DNSName)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 181, in _dnsname_to_stdlib
    name = idna_encode(name)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 179, in idna_encode
    return idna.encode(name)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py", line 361, in encode
    s = alabel(label)
  File "/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py", line 273, in alabel
    raise IDNAError('The label {0} is not a valid A-label'.format(label))
idna.core.IDNAError: The label b'xn--n3h' is not a valid A-label
```

They're correct. This is firmly in `urllib3` in it's `urllib3.contrib.pyopenssl` module that uses pyOpenSSL. That's clear in the stack trace.