Skip to content

ssl.wrap_socket deprecated #41

Description

@TBE25

Describe the bug
We discovered that our security scanner (AWS InspectorV2) found a potential issue with the following snipped located in "ld_eventsource/testing/http_util.py"

        if secure:
            self.server.socket = ssl.wrap_socket(
                self.server.socket,
                certfile='./ld_eventsource/testing/selfsigned.pem',  
                keyfile='./ld_eventsource/testing/selfsigned.key',
                server_side=True,
            )

It states that ssl.wrap_socket is deprecated and should be replaced with SSLContext.wrap_socket.
The snippet above should look like that:

if secure:
            self.server.socket = SSLContext.wrap_socket(
                self.server.socket,
                certfile='./ld_eventsource/testing/selfsigned.pem',  
                keyfile='./ld_eventsource/testing/selfsigned.key',
                server_side=True,
            )

To reproduce

  • Install the library in any project
  • Scan the artifact with AWS InspectorV2

SDK version

  • launchdarkly-eventsource:1.2.2

Language version, developer tools
Python 3.12.8

OS/platform
MacOS

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions