§
    Ètºfæ  ã                  ó  — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
  e e
e                     d¦  «        ¦  «                             d¦  «        j        ¦  «        Z G d	„ d
ej        ¦  «        Z G d„ d¦  «        ZdS )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.
é    )Úannotations)ÚSSL)Ússl)ÚnativeString)ÚFilePathzutf-8s
   server.pemc                  ó   — e Zd ZdZdZdd„ZdS )ÚClientTLSContextz:
    SSL Context Factory for client-side connections.
    é   ÚreturnúSSL.Contextc                ó>   — t          j        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)Úselfs    úW/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/test/ssl_helpers.pyÚ
getContextzClientTLSContext.getContext   s   € õ Œ{�3Ô,Ñ-Ô-Ð-ó    N©r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚisClientr   © r   r   r	   r	      s9   € € € € € ðð ð €Hð.ð .ð .ð .ð .ð .r   r	   c                  ó,   — e Zd ZdZdZedfdd
„Zdd„ZdS )ÚServerTLSContextz:
    SSL Context Factory for server-side connections.
    r   NÚfilenameústr | bytesÚmethodú
int | Noner   ÚNonec                ó>   — || _         |€t          j        }|| _        d S )N)r   r   r   Ú_method)r   r   r   s      r   Ú__init__zServerTLSContext.__init__.   s#   € ð !ˆŒØˆ>ÝÔ&ˆFàˆŒˆˆr   r   c                ó    — t          j        | 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   Úctxs     r   r   zServerTLSContext.getContext7   sF   € õ Œk˜$œ,Ñ'Ô'ˆØ× Ò  ¤Ñ/Ô/Ð/Ø×Ò ¤Ñ.Ô.Ð.Øˆ
r   )r   r   r   r    r   r!   r   )r   r   r   r   r   ÚcertPathr$   r   r   r   r   r   r   '   sY   € € € € € ðð ð €Hð '/ÀTðð ð ð ð ðð ð ð ð ð r   r   N)r   Ú
__future__r   ÚOpenSSLr   Útwisted.internetr   Útwisted.python.compatr   Útwisted.python.filepathr   Ú__file__ÚencodeÚsiblingÚpathr)   ÚClientContextFactoryr	   r   r   r   r   ú<module>r4      s   ððð ð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð à  Ð  Ð  Ð  Ð  Ð  Ø .Ð .Ð .Ð .Ð .Ð .Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,àˆ<˜˜ §¢°Ñ!9Ô!9Ñ:Ô:×BÒBÀ=ÑQÔQÔVÑWÔW€ð.ð .ð .ð .ð .�sÔ/ñ .ô .ð .ð$ð ð ð ð ñ ô ð ð ð r   