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

except UnicodeError:
            raise ValueError("%s must be an all-ascii string." % repr(ipname))
        
        if sys.version_info < (3,):
            n_ipname = b_ipname
        else:
            n_ipname = ipname
        if n_ipname.count('.') == 3:
            try:
                return socket.inet_aton(n_ipname)
            
            
            
            except (OSError, socket.error, TypeError):
                pass
        try:
            return socket.inet_pton(socket.AF_INET6, n_ipname)
        
        
        
        except (OSError, socket.error, TypeError):
            
            raise ValueError("%s is neither an IPv4 nor an IP6 "
                             "address." % repr(ipname))
        except AttributeError:
            
            pass
        
        raise ValueError("%s is not an IPv4 address." % repr(ipname))
    def _ipaddress_match(ipname, host_ip):