|
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__/ |
U
>��g�$ �
@ sR d Z ddlZddlZddlZddlZddlT dZdZdZej �
ej �e��Z
dJdd�Zd
Zdd� Zdd� Zdd� Zedk�rNe�e
� eddd�\ZZedd��Ze�e� W 5 Q R X edd��Ze�e� W 5 Q R X ed� edddddd d!d"d#g � edddddd$d!d"d#g � ed%d��Ze�e� e�e� W 5 Q R X ed$d&��Ze�e� W 5 Q R X e� ed'dd�\ZZed(d��Ze�e� e�e� W 5 Q R X edd)d*�\ZZed+d��Ze�e� e�e� W 5 Q R X ed'd)d*�\ZZed,d��Ze�e� e�e� W 5 Q R X ed-d)d.d/�\ZZed0d��Ze�e� e�e� W 5 Q R X d1d2d3d4d5d6d7d8d9g Zed:d)d;�e�d<�\ZZed=d��Ze�e� e�e� W 5 Q R X d>d?d@dAdBgZedCd)d;�e�d<�\ZZedDd��Ze�e� e�e� W 5 Q R X edEd)dFdG�\ZZedHd��Ze�e� e�e� W 5 Q R X e� 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:3072c C s� t d| � g }td�D ](}tjdd��}|�|j� W 5 Q R X q|\}} }
�z$tj | |t
td�}t|d��}|�
|� W 5 Q R X ddd d
dd|d
|
d|d|g
}
|r�tjdd��}|�|j� |j}W 5 Q R X |
d|g7 }
n|
dd| g7 }
tdg|
� |�r,dd|d|d| dddddd|g}
tdg|
� t| d��}|�� }W 5 Q R X t|
d��}|�� }W 5 Q R X ||fW �S |D ]}t�|� �qxX d S )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�formatr r �open�write�
check_call�read)r �signr
�ext�keyZ tempnames�i�fZreq_fileZ cert_fileZkey_filer"