Repeated certificate requests fail when using Digicert (maybe other CAs too)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start with cloud_connection.py at line 406 and reproduce the two requests using the vcert 0.16.0 example in main.py. Compare the TLSPC response for the first and subsequent requests, then make the second request complete without the IndexError while preserving the returned certificate information.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
PROBLEM SUMMARY
For a single given common name, and using a Digicert CA on TLSPC, only the very first call to conn.request_cert(request, zone) succeeds. All subsequent attempts will fail before the SDK reaches the end of its procedure.
STEPS TO REPRODUCE
- Use TLSPC with a configured Digicert CA named
Digicert Test Account APM(change code for alternate Digicert CA as appropriate) venafidemo.comshould be a known/proven domain name in the Digicert account (change code for alternate domain name as appropriate)- Run the following code:
requirements.txt
vcert==0.16.0
main.py
import os
from datetime import datetime
from vcert import (CertificateRequest, venafi_connection, CSR_ORIGIN_SERVICE)
from vcert.policy.policy_spec import (PolicySpecification, Policy, Defaults)
def main():
# set up vars/params
api_key = os.environ.get('TLSPCAPIKey')
tlspc_ca = 'Digicert Test Account APM' # ... or similar DIGICERT CA in TLSPC
cert_auth = f'DIGICERT\\{tlspc_ca}\\ssl_cloud_wildcard'
max_valid_days = 90
zone = 'venafidemo-bugtest-app\\venafidemo-bugtest-cit'
domain = 'venafidemo.com' # use a domain known to you your Digicert account
timestamp = datetime.now().now().strftime("%Y%m%d%H%M%S") # using a timestamp ensures Digicert has never before seen this CN
common_name = f'www{timestamp}.{domain}'
passphrase = 'Password123!'
# build connection
conn = venafi_connection(api_key=api_key)
# build policy (immutable code)
policy_spec = PolicySpecification()
policy_spec.policy = Policy(
cert_auth = cert_auth,
max_valid_days = max_valid_days,
domains = [domain]
)
policy_spec.defaults = Defaults()
conn.set_policy(zone, policy_spec)
# build 1st request
print(f'1st request for {common_name} ...')
request = CertificateRequest(common_name=common_name)
request.csr_origin = CSR_ORIGIN_SERVICE
request.key_password = passphrase
conn.request_cert(request, zone)
# GOOD - FIRST CALL WORKS
# build 2nd request
print(f'2nd request for {common_name} ...')
request2 = CertificateRequest(common_name=common_name)
request2.csr_origin = CSR_ORIGIN_SERVICE
request2.key_password = passphrase
conn.request_cert(request2, zone)
# BANG!
# SECOND CALL blows up on cloud_connection.py (line 406) with IndexError: list index out of range
# line 406 as follows:
# request.cert_guid = data['certificateRequests'][0]['certificateIds'][0]
if __name__ == '__main__':
main()
EXPECTED RESULTS
Expect the SECOND call to work as per the FIRST.
ACTUAL RESULTS
As described above
ENVIRONMENT DETAILS
As described above
COMMENTS/WORKAROUNDS
It would appear that the VCert CLI does not fail in the same way, which may indicate that the Golang code does not exhibit this bug.
FWIW it would appear that subsequent calls do succeed from the POV of both Digicert and TLSPC. That is to say repeat certificates are visible in these systems. However the format of the TLSPC response to the client must be different from the first call and incompatible with the current SDK code, which causes the error.
There is currently no workaround.
- Ngôn ngữ chính
- Python
- Star
- 22
- Fork
- 23
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 13
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Venafi/vcert-python
-
RFC: Drop Python 3.9 support Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
Venafi/vcert-python#208 ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Venafi/vcert-python#114 ·
-
Venafi/vcert-python#91 · 1 người được giao ·
-
Refactor and optimize code Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Venafi/vcert-python#42 ·
Tất cả issue của Venafi/vcert-python
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·