Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/make_ssl_certs.cpython-38.pyc
U

>��g�$�
@sRdZddlZddlZddlZddlZddlTdZdZdZej	�
ej	�e��Z
dJdd�Zd
Zdd�Zdd�Zdd�Zedk�rNe�e
�eddd�\ZZedd��Ze�e�W5QRXedd��Ze�e�W5QRXed�edddddd d!d"d#g	�edddddd$d!d"d#g	�ed%d��Ze�e�e�e�W5QRXed$d&��Ze�e�W5QRXe�ed'dd�\ZZed(d��Ze�e�e�e�W5QRXedd)d*�\ZZed+d��Ze�e�e�e�W5QRXed'd)d*�\ZZed,d��Ze�e�e�e�W5QRXed-d)d.d/�\ZZed0d��Ze�e�e�e�W5QRXd1d2d3d4d5d6d7d8d9g	Zed:d)d;�e�d<�\ZZed=d��Ze�e�e�e�W5QRXd>d?d@dAdBgZedCd)d;�e�d<�\ZZedDd��Ze�e�e�e�W5QRXedEd)dFdG�\ZZedHd��Ze�e�e�e�W5QRXe�edI�ed%�ed+�dS)KzOMake the custom certificate and private key files used by test_ssl
and friends.�N)�*Z20180829142316ZZ20371028142316Za�

    [ default ]
    base_url               = http://testca.pythontest.net/testca

    [req]
    distinguished_name     = req_distinguished_name
    prompt                 = no

    [req_distinguished_name]
    C                      = XY
    L                      = Castle Anthrax
    O                      = Python Software Foundation
    CN                     = {hostname}

    [req_x509_extensions_nosan]

    [req_x509_extensions_simple]
    subjectAltName         = @san

    [req_x509_extensions_full]
    subjectAltName         = @san
    keyUsage               = critical,keyEncipherment,digitalSignature
    extendedKeyUsage       = serverAuth,clientAuth
    basicConstraints       = critical,CA:false
    subjectKeyIdentifier   = hash
    authorityKeyIdentifier = keyid:always,issuer:always
    authorityInfoAccess    = @issuer_ocsp_info
    crlDistributionPoints  = @crl_info

    [ issuer_ocsp_info ]
    caIssuers;URI.0        = $base_url/pycacert.cer
    OCSP;URI.0             = $base_url/ocsp/

    [ crl_info ]
    URI.0                  = $base_url/revocation.crl

    [san]
    DNS.1 = {hostname}
    {extra_san}

    [dir_sect]
    C                      = XY
    L                      = Castle Anthrax
    O                      = Python Software Foundation
    CN                     = dirname example

    [princ_name]
    realm = EXP:0, GeneralString:KERBEROS.REALM
    principal_name = EXP:1, SEQUENCE:principal_seq

    [principal_seq]
    name_type = EXP:0, INTEGER:1
    name_string = EXP:1, SEQUENCE:principals

    [principals]
    princ1 = GeneralString:username

    [ ca ]
    default_ca      = CA_default

    [ CA_default ]
    dir = cadir
    database  = $dir/index.txt
    crlnumber = $dir/crl.txt
    default_md = sha256
    startdate = {startdate}
    default_startdate = {startdate}
    enddate = {enddate}
    default_enddate = {enddate}
    default_days = 7000
    default_crl_days = 7000
    certificate = pycacert.pem
    private_key = pycakey.pem
    serial    = $dir/serial
    RANDFILE  = $dir/.rand
    policy          = policy_match

    [ policy_match ]
    countryName             = match
    stateOrProvinceName     = optional
    organizationName        = match
    organizationalUnitName  = optional
    commonName              = supplied
    emailAddress            = optional

    [ policy_anything ]
    countryName   = optional
    stateOrProvinceName = optional
    localityName    = optional
    organizationName  = optional
    organizationalUnitName  = optional
    commonName    = supplied
    emailAddress    = optional


    [ v3_ca ]

    subjectKeyIdentifier=hash
    authorityKeyIdentifier=keyid:always,issuer
    basicConstraints = CA:true

    F��req_x509_extensions_full�rsa:3072cCs�td|�g}td�D](}tjdd��}|�|j�W5QRXq|\}}	}
�z$tj	||t
td�}t|d��}|�
|�W5QRXddd	d
dd|d
|
d|d|g
}
|r�tjdd��}|�|j�|j}W5QRX|
d|g7}
n|
dd|	g7}
tdg|
�|�r,dd|d|d|	dddddd|g}
tdg|
�t|	d��}|��}W5QRXt|
d��}|��}W5QRX||fW�S|D]}t�|��qxXdS)Nzcreating cert for �F)�delete��hostname�	extra_san�	startdate�enddate�w�req�-new�-nodesz-daysZ7000�-newkey�-keyout�-extensions�-config�-outz-x509�openssl�ca�-outdir�cadirz-policyZpolicy_anything�-batch�-infiles�r)�print�range�tempfile�NamedTemporaryFile�append�name�os�remove�req_template�formatrr�open�write�
check_call�read)r	�signr
�ext�keyZ	tempnames�i�fZreq_fileZ	cert_fileZkey_filer"r�argsZreqfile�cert�r2�2/opt/cppython/lib/python3.8/test/make_ssl_certs.py�
make_cert_keywsp
�
��	r4rcCst�t�dS)N)�shutil�rmtree�	TMP_CADIRr2r2r2r3�	unmake_ca�sr8cCs�t�t�ttj�dd�d��}W5QRXttj�dd�d��}|�d�W5QRXttj�dd�d��}|�d�W5QRXttj�dd	�d
��}|�d�W5QRXt�d
���}t	j
dd
ttd�}|�|�|�
�t����}dd|jddddddd|jddg
}tdg|�dd|jddddtddd d!d"d#|jg}tdg|�dd|jd$dd%g}tdg|�W5QRXW5QRXtdd&d'ddd(g�t�d(d)�dS)*Nrz	index.txt�a+zcrl.txtZ00zindex.txt.attrzw+zunique_subject = no�serialr
zCB2D80995A69525B
z
our-ca-serverrrrrrrrrrzpycakey.pemrz-subjzG/C=XY/L=Castle Anthrax/O=Python Software Foundation CA/CN=our-ca-serverrrzpycacert.pemrrz-keyfilez	-selfsignrZv3_carz-gencrlzrevocation.crlZx509�-inzcapath/ceff1710.0zcapath/b1930218.0)r#�mkdirr7r'�path�joinr(rr r%r&rr�flushr"r)r5�copy)r/�trr0r2r2r3�make_ca�sr

�


��"�rBcCsddl}t�|�|��dS)Nr)�_ssl�pprintZ_test_decode_cert)r=rCr2r2r3�
print_cert�srE�__main__�	localhostZreq_x509_extensions_simple)r,zssl_cert.pemr
zssl_key.pemz5password protecting ssl_key.pem in ssl_key.passwd.pemrZpkeyr;rzssl_key.passwd.pemz-aes256z-passoutz
pass:somepasszkeycert.passwd.pemzkeycert.pemr9Zfakehostnamezkeycert2.pemT)r+zkeycert3.pemzkeycert4.pemz
localhost-ecczparam:secp384r1.pem)r+r-zkeycertecc.pemz0otherName.1 = 1.2.3.4;UTF8:some other identifierz/otherName.2 = 1.3.6.1.5.2.2;SEQUENCE:princ_namezemail.1 = user@example.orgzDNS.2 = www.example.orgzdirName.1 = dir_sectzURI.1 = https://www.python.org/zIP.1 = 127.0.0.1z
IP.2 = ::1zRID.1 = 1.2.3.4.5Zallsans�
)r+r
zallsans.pemz'DNS.2 = xn--knig-5qa.idn.pythontest.netz6DNS.3 = xn--knigsgsschen-lcb0w.idna2003.pythontest.netz6DNS.4 = xn--knigsgchen-b4a3dun.idna2008.pythontest.netz,DNS.5 = xn--nxasmq6b.idna2003.pythontest.netz,DNS.6 = xn--nxasmm1c.idna2008.pythontest.netZidnsanszidnsans.pemZnosanZreq_x509_extensions_nosan)r+r,z	nosan.pemz=update Lib/test/test_ssl.py and Lib/test/test_asyncio/util.py)Frrr)�__doc__r#rDr5r�
subprocessrrr%r=�abspath�dirname�__file__�herer4r7r8rBrE�__name__�chdirr1r-r'r/r(rr)r
r>r2r2r2r3�<module>s�g�
5,





�

�
�



F1le Man4ger