Ë
    ojæ  ã                  óî   — 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j                  d«      «      j                  d«      j                  «      Z G d	„ d
ej                   «      Z G d„ d«      Zy)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y)ÚClientTLSContextz:
    SSL Context Factory for client-side connections.
    é   c                óH   — 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    ú:/usr/lib/python3/dist-packages/twisted/test/ssl_helpers.pyÚ
getContextzClientTLSContext.getContext   s   € ô �{‰{œ3×,Ñ,Ó-Ð-ó    N©ÚreturnzSSL.Context)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚisClientr   © r   r   r	   r	      s   „ ñð €Hô.r   r	   c                  ó4   — e Zd ZdZdZedf	 	 	 	 	 dd„Zdd„Zy)ÚServerTLSContextz:
    SSL Context Factory for server-side connections.
    r   Nc                óD   — || _         |€t        j                  }|| _        y )N)Úfilenamer   r   Ú_method)r   r   Úmethods      r   Ú__init__zServerTLSContext.__init__.   s"   € ð !ˆŒØˆ>Ü×&Ñ&ˆFàˆ�r   c                ó°   — t        j                  | j                  «      }|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   s?   € ô �k‰k˜$Ÿ,™,Ó'ˆØ× Ñ  §¡Ô/Ø×Ñ §¡Ô.Øˆ
r   )r   zstr | bytesr   z
int | Noner   ÚNoner   )r   r   r   r   r   ÚcertPathr    r   r   r   r   r   r   '   s7   „ ñð €Hð '/ÀTðØ#ðØ8Bðà	óô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>r1      s`   ðñõ #å å  Ý .Ý ,á™ §¡°Ó!9Ó:×BÑBÀ=ÓQ×VÑVÓW€ô.�s×/Ñ/ô .÷$ò r   