Ok, I figured out what was wrong. It was kind of foolish of me. I had two problems with my code. My first mistake was when specifying the ssl_version I put in TLSv1 when it should have been ssl.PROTOCOL_TLSv1. The second mistake was that I wasn't referencing the wrapped socket, instead I was calling the original socket that I have created. The below code seemed to work for me.

import socket
import ssl

# SET VARIABLES
packet, reply = "<packet>SOME_DATA</packet>", ""
HOST, PORT = 'XX.XX.XX.XX', 4434

# CREATE SOCKET
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(10)

# WRAP SOCKET
wrappedSocket = ssl.wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLSv1, ciphers="ADH-AES256-SHA")

# CONNECT AND PRINT REPLY
wrappedSocket.connect((HOST, PORT))
wrappedSocket.send(packet)
print wrappedSocket.recv(1280)

# CLOSE SOCKET CONNECTION
wrappedSocket.close()

Hope this can help somebody!

Answer from Raffi on Stack Overflow
🌐
Python
docs.python.org › 3 › library › ssl.html
ssl — TLS/SSL wrapper for socket objects — Python 3.14.4 ...
Source code: Lib/ssl.py This module provides access to Transport Layer Security (often known as “Secure Sockets Layer”) encryption and peer authentication facilities for network sockets, both clien...
🌐
Snyk
snyk.io › blog › implementing-tls-ssl-python
Implementing TLS/SSL in Python | Snyk
October 16, 2022 - In this article, we’ll explore TLS and how to use Python to check for a website’s TLS certificate validity. Then, we’ll walk through the steps for adding TLS to your Python application on Linux.
🌐
W3Schools
w3schools.com › python › ref_module_ssl.asp
Python ssl Module
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... import ssl print(f'OpenSSL version: {ssl.OPENSSL_VERSION}') print(f'Has SNI: {ssl.HAS_SNI}') Try it Yourself »
🌐
DataFlair
data-flair.training › blogs › 4-step-python-ssl-tutorial-to-secure-your-websites
4-step Python SSL Tutorial to Secure Your Websites - DataFlair
May 1, 2023 - You can use a Bash, Dash, or any other console to generate a private key and CSR using the OpenSSL command. Let us start our Python SSL tutorial by first understanding the CSR generation process.
🌐
The Python Code
thepythoncode.com › article › add-a-tls-ssl-certificate-in-python-code
How to Add a TLS/SSL Certificate in Python Code - The Python Code
Learn how to secure your Python applications with TLS/SSL certificates. Understand the importance of these cryptographic protocols, and grasp how to integrate SSL certificates into Python code using requests library.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-install-and-use-ssl-certificate-in-python
How to Install and use SSL Certificate In Python - GeeksforGeeks
July 23, 2025 - Python Tutorial · Data Types · Interview Questions · Examples · Quizzes · DSA Python · Data Science · NumPy · Pandas · Practice · Django · Flask · Last Updated : 23 Jul, 2025 · A secure Socket Layer (SSL) Certificate is a Digital certificate that can be used for the authentication of a website and it helps to establish an encrypted connection between the user and server.
🌐
Readthedocs
m2crypto.readthedocs.io › en › latest › howto.ssl.html
HOWTO: Programming SSL in Python with M2Crypto — M2Crypto documentation
Within the implementations, Python’s HTTPSConnection employs a FakeSocket object, which collects all input from the SSL connection before returning it to the application as a StringIO buffer, whereas M2Crypto’s HTTPSConnection uses a buffering M2Crypto.BIO.IOBuffer object that works over the underlying M2Crypto.SSL.Connection directly.
Find elsewhere
🌐
Readthedocs
python-security.readthedocs.io › ssl.html
Python SSL and TLS security — Python Security 0.0 documentation
New in Python 3.2. ... SSLContext.load_verify_locations(): This method can also load certification revocation lists (CRLs) in PEM or DER format.
🌐
MicroPython
docs.micropython.org › en › latest › library › ssl.html
ssl – SSL/TLS module — MicroPython latest documentation
Wrap the given sock and return a new wrapped-socket object. The implementation of this function is to first create an SSLContext and then call the SSLContext.wrap_socket method on that context object. The arguments sock, server_side and server_hostname are passed through unchanged to the method ...
🌐
Real Python
realpython.com › python-https
Exploring HTTPS With Python – Real Python
July 12, 2021 - In this tutorial, you'll gain a working knowledge of the various factors that combine to keep communications over the Internet safe. You'll see concrete examples of how to keep information secure and use cryptography to build your own Python ...
🌐
GitHub
gist.github.com › SeanPesce › af5f6b7665305b4c45941634ff725b7a
Simple Python 3 HTTPS Server (SSL/TLS) · GitHub
This Python 3 script mimics the behavior of python2.7 -m SimpleHTTPServer 80 and python3 -m http.server 80, but with support for SSL/TLS/HTTPS.
🌐
Linux Hint
linuxhint.com › python-ssl-example
Python SSL Example
Linux Hint LLC, [email protected] 1210 Kelly Park Circle, Morgan Hill, CA 95037 Privacy Policy and Terms of Use
🌐
Python
wiki.python.org › moin › SSL
SSL - Python Wiki
This allows successful ... name specified in certificate. Client need to connect to server over SSL, fetch its certificate, check that the certificate is valid (signed properly) and belongs to this server (server name)....
🌐
Medium
medium.com › @mastindergmail1 › title-a-complete-guide-to-setting-up-ssl-for-your-python-application-with-nginx-fc5708fdfef9
Title: A Complete Guide to Setting Up SSL for Your Python Application with Nginx | by mastinder@gmail.com | Medium
January 22, 2024 - This guide will take you through the process of securing your Python application with an SSL certificate, configuring Nginx to serve it over HTTPS, and ensuring everything is set up correctly.
🌐
PyPI
pypi.org › project › ssl
ssl · PyPI
April 20, 2013 - The old socket.ssl() support for TLS over sockets is being superseded in Python 2.6 by a new ‘ssl’ module.
      » pip install ssl
    
Published   Apr 20, 2013
Version   1.16
🌐
K-state
faculty.salina.k-state.edu › tim › NPstudy_guide › ssl › ssl.html
8. Topic 5 - SSL — Network Programming Study Guide
The newer name for Secure Sockets ... known as SSL. ... Certificates may be either self signed or verified by one of a few trusted Certificate Authorities (CA) Often used with HTTP (i.e., https://www...). It can be used with SMTP, ssh, scp, or any client / server communication. Python has basic ...
🌐
Pythontic
pythontic.com › ssl › sslsocket › introduction
The SSLSocket class in Python | Pythontic.com
The SSLSocket class is derived from the socket class. The SSLSocket class provides TLS handshake and secure communication over the TCP/IP socket.
🌐
FavTutor
favtutor.com › blogs › python-ssl-secure-website
How to use SSL Certificate with Python Code?
July 5, 2023 - Learning how to secure your website using an SSL certificate with the help of Python. Find how to get a Python SSL certificate.