| Server IP : 62.171.151.215 / Your IP : 216.73.217.53 Web Server : nginx/1.18.0 System : Linux vmi3128365 5.15.0-176-generic #186-Ubuntu SMP Fri Mar 13 11:01:42 UTC 2026 x86_64 User : alex ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/test/__pycache__/ |
Upload File : |
o
�br � @ sr d Z ddlmZ ddlmZ ddlmZ ddlmZ eee �
d���d�j�Z
G dd � d ej�ZG d
d� d�ZdS )
z�
Helper classes for twisted.test.test_ssl.
They are in a separate module so they will not prevent test_ssl importing if
pyOpenSSL is unavailable.
� )�SSL)�ssl)�nativeString)�FilePathzutf-8s
server.pemc @ s e Zd ZdZdZdd� ZdS )�ClientTLSContextz:
SSL Context Factory for client-side connections.
� c C s t �t j�S )z�
Return an L{SSL.Context} to be use for client-side connections.
Will not return a cached context.
This is done to improve the test coverage as most implementation
are caching the context.
)r �Context�
SSLv23_METHOD)�self� r �:/usr/lib/python3/dist-packages/twisted/test/ssl_helpers.py�
getContext s zClientTLSContext.getContextN)�__name__�
__module__�__qualname__�__doc__�isClientr
r r r r r s r c @ s* e Zd ZdZdZedfdd�Zdd� ZdS )�ServerTLSContextz:
SSL Context Factory for server-side connections.
r Nc C s || _ |d u r
tj}|| _d S )N)�filenamer r �_method)r
r �methodr r r �__init__- s
zServerTLSContext.__init__c C s( t �| j�}|�| j� |�| j� |S )z�
Return an L{SSL.Context} to be use for server-side connections.
Will not return a cached context.
This is done to improve the test coverage as most implementation
are caching the context.
)r r r �use_certificate_filer �use_privatekey_file)r
�ctxr r r r
4 s zServerTLSContext.getContext)r r r r r �certPathr r
r r r r r &