HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_smtpnet.cpython-310.opt-1.pyc
o

�i��@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/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

*�