Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.145.53.93
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_smtpnet.cpython-310.pyc
o

ab��@s�ddlZddlmZddlmZddlmZddlZddlZe�d�Z	e�
d�dd�ZGd	d
�d
ej�Z
Gdd�dej�Zed
krHe��dSdS)�N)�support)�
import_helper)�
socket_helper�sslZnetworkc	Cszt��}t�||f��(}z	|j||d�}Wnty%YWd�dSw|��	Wd�dS1s6wYdS)N)Zserver_hostnameFT)r�create_default_context�socket�create_connectionZwrap_socket�	Exception�close)�host�port�context�sock�r�:/usr/local/python-3.10/lib/python3.10/test/test_smtpnet.py�check_ssl_verifiys�$�rc@seZdZdZdZdd�ZdS)�SmtpTest�smtp.gmail.comiKcCs�t�td�t�tj�}d|_tj|_t	�
|j��Ft�|j|j
�}z|j|d�Wn$tjyN}z|jddkrCt�|jd�n�WYd}~nd}~ww|��|��Wd�dS1sbwYdS)N�SMTP_SSLF�r
rz+STARTTLS extension not supported by server.)r�
get_attribute�smtplibr�
SSLContext�PROTOCOL_TLS_CLIENT�check_hostname�	CERT_NONE�verify_moder�transient_internet�
testServerZSMTP�
remotePortZstarttlsZ
SMTPException�args�unittest�skip�ehlo�quit)�selfr
�server�errr�test_connect_starttlss$���
"�zSmtpTest.test_connect_starttlsN)�__name__�
__module__�__qualname__rrr(rrrrrsrc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�SmtpSSLTestri�cCs^t�td�t�|j��t�|j|j�}|��|�	�Wd�dS1s(wYdS�Nr)
rrrrrrrrr#r$�r%r&rrr�test_connect2s
"�zSmtpSSLTest.test_connectcCsZt�td�t�|j��t�|j�}|��|��Wd�dS1s&wYdSr-)	rrrrrrrr#r$r.rrr�test_connect_default_port9s
"�z%SmtpSSLTest.test_connect_default_portcCs|t�tj�}d|_tj|_t�td�t	�
|j��tj|j|j
|d�}|��|��Wd�dS1s7wYdS)NFrr)rrrrrrrrrrrrrrr#r$)r%r
r&rrr�test_connect_using_sslcontext@s
"�z)SmtpSSLTest.test_connect_using_sslcontextcCs�t�|j��t|j|j�}|s|�d�Wd�n1swYt�td�t	�
�}t�|j��tj|j|j|d�}|��|�
�Wd�dS1sRwYdS)Nz!SSL certificate can't be verifiedrr)rrrrrZskipTestrrrrrrr#r$)r%Z
can_verifyr
r&rrr�&test_connect_using_sslcontext_verifiedJs
��
"�z2SmtpSSLTest.test_connect_using_sslcontext_verifiedN)	r)r*r+rrr/r0r1r2rrrrr,.s
r,�__main__)r!�testrZtest.supportrrrr�
import_modulerZrequiresrZTestCaserr,r)�mainrrrr�<module>s

*�
© 2025 GrazzMean