jasonrbriggs / stomp.py

“stomp.py” is a Python client library for accessing messaging servers (such as ActiveMQ or RabbitMQ) using the STOMP protocol (versions 1.0, 1.1 and 1.2). It can also be run as a standalone, command-line client for testing.
Apache License 2.0
491 stars 167 forks source link

NameError: name 'dt' is not defined when SSL certificate expired #397

Closed hotea closed 1 year ago

hotea commented 2 years ago

stomp.py version 8.0.1 path: stomp.transport.check_ssl_certificate

File "./lib/python3.9/site-packages/stomp/connect.py", line 198, in connect self.transport.start() File "./lib/python3.9/site-packages/stomp/transport.py", line 125, in start self.attempt_connection() File "./lib/python3.9/site-packages/stomp/transport.py", line 759, in attempt_connection check_ssl_certificate(host_and_port) File "./lib/python3.9/site-packages/stomp/transport.py", line 55, in check_ssl_certificate logging.info("SSL certificate for %s:%s expired on %s", host, port, dt) NameError: name 'dt' is not defined

Expected Behavior

show a log

Current Behavior

raised an exception

Possible Solution

define the 'dt' as: dt = x509_cert.not_valid_after

Steps to Reproduce

need the server cert expired

jasonrbriggs commented 1 year ago

Don't believe this is an issue as of 8.0.2