### 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

raise CertificateError(
                "wildcard can only be present in the leftmost label: "
                "%s." % repr(dn))
        if not sep:
            
            
            raise CertificateError(
                "sole wildcard without additional labels are not support: "
                "%s." % repr(dn))
        if dn_leftmost != '*':
            
            
            raise CertificateError(
                "partial wildcards in leftmost label are not supported: "
                "%s." % repr(dn))
        hostname_leftmost, sep, hostname_remainder = hostname.partition('.')
        if not hostname_leftmost or not sep:
            
            return False
        return dn_remainder.lower() == hostname_remainder.lower()
    def _inet_paton(ipname):
        """Try to convert an IP address to packed binary form
        Supports IPv4 addresses on all platforms and IPv6 on platforms with IPv6
        support.
        """
        
        
        try:
            b_ipname = to_bytes(ipname, errors='strict')