Skip to content

Fix use of deprecated parameters in module_utils/urls.py #80490

@mattclay

Description

@mattclay

Summary

In Python 3.12 the deprecated key_file, cert_file and check_hostname parameters have been removed.

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

def _build_https_connection(self, host, **kwargs):
kwargs.update({
'cert_file': self.client_cert,
'key_file': self.client_key,
})

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

Metadata

Metadata

Assignees

Labels

P2Priority 2 - Issue Blocks Releaseaffects_2.16featureThis issue/PR relates to a feature request.has_prThis issue has an associated PR.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions