### Summary

In Python 3.12 the deprecated `key_file`, `cert_file` and `check_hostname` parameters have been [removed](https://docs.python.org/3.12/library/http.client.html#http.client.HTTPSConnection).

There is code which still attempts to set these, such as:

https://github.com/ansible/ansible/blob/0371ea08d6de55635ffcbf94da5ddec0cd809495/lib/ansible/module_utils/urls.py#L604-L608

Which results in an error under Python 3.12:

```
>       return httplib.HTTPSConnection(host, **kwargs)
E       TypeError: HTTPSConnection.__init__() got an unexpected keyword argument 'cert_file'
```

### Issue Type

Feature Idea

### Component Name

module_utils/urls.py

m.attach(part)
    if PY3:
        
        
        b_data = m.as_bytes(policy=email.policy.HTTP)
    else:
        
        
        
        fp = cStringIO()  
        
        g = email.generator.Generator(fp, maxheaderlen=0)
        g.flatten(m)
        
        b_data = email.utils.fix_eols(fp.getvalue())
    del m
    headers, sep, b_content = b_data.partition(b'\r\n\r\n')
    del b_data
    if PY3:
        parser = email.parser.BytesHeaderParser().parsebytes
    else:
        
        parser = email.parser.HeaderParser().parsestr
    return (
        parser(headers)['content-type'],  
        b_content
    )
#
#
def basic_auth_header(username, password):