Skip to content

Conversation

@ddelnano
Copy link
Member

@ddelnano ddelnano commented Dec 10, 2025

Summary: Fix openssl bpf test failure introduced by python 3.12 upgrade

The OpenSSLTraceTest/5.ssl_capture_ruby_client test began failing on main after #2288 was merged. This PR resolves the failure and renames the container to better reflect its intended coverage (to test Python 3.10+ runtimes, which previously had TLS tracing gaps).

Relevant Issues: #2290

Type of change: /kind bugfix

Test Plan: Build succeeds and verified the following locally

  • OpenSSLTraceTest/5.ssl_capture_ruby_client passes
  • The python 3.12 based container still triggers SSL_read_ex and SSL_write_ex library functions

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
(cherry picked from commit d12d0f5)
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
(cherry picked from commit a958b02)
Comment on lines +52 to +54
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ssl_context.load_cert_chain(certfile='/etc/ssl/server.crt', keyfile="/etc/ssl/server.key")
httpd.socket = ssl_context.wrap_socket(httpd.socket, server_side=True)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.12 removed the previous APIs. The container was crashing with the following error:

Traceback (most recent call last):
  File "/app/src/stirling/source_connectors/socket_tracer/testing/containers/ssl/python_min_310_https_server.binary.runfiles/px/src/stirling/source_connectors/socket_tracer/testing/containers/ssl/https_server.py", line 52, in <module>
    httpd.socket = ssl.wrap_socket(httpd.socket,
                   ^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'
2025-12-10 00:18:15,003 INFO sys.version_info(major=3, minor=12, micro=0, releaselevel='final', serial=0)
2025-12-10 00:18:15,003 INFO pid=1
Traceback (most recent call last):
  File "/app/src/stirling/source_connectors/socket_tracer/testing/containers/ssl/python_min_310_https_server.binary.runfiles/px/src/stirling/source_connectors/socket_tracer/testing/containers/ssl/https_server.py", line 52, in <module>
    httpd.socket = ssl.wrap_socket(httpd.socket,
                   ^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'

@ddelnano ddelnano marked this pull request as ready for review December 10, 2025 04:04
@ddelnano ddelnano requested a review from a team as a code owner December 10, 2025 04:04
@ddelnano ddelnano merged commit b81253e into pixie-io:main Dec 10, 2025
28 checks passed
@ddelnano ddelnano deleted the ddelnano/fix-openssl-test-py312-upgrade branch December 10, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants