`StorageVirtualizeAPI` constructor ignores `Configuration` object, making it impossible to disable SSL
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu trong openapi_client/api/storage_virtualize_api.py, tại phần mã init quanh dòng 53, sau đó đối chiếu với phần Troubleshooting trong README và cách sử dụng Configuration trong script tái hiện. Chạy ví dụ độc lập trong một môi trường có chứng chỉ tự ký; hoàn tất khi wrapper tôn trọng verify_ssl=False thay vì phát sinh lỗi xác minh chứng chỉ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The README Troubleshooting section instructs users to disable SSL by setting config.verify_ssl = False.
However, the StorageVirtualizeAPI wrapper ignores this completely. The bug is right here in your constructor __init__ code (storage_virtualize_api.py#L53), where it overwrites the user's configuration with a blank one:
def __init__(self, ip_address: str, username_or_token: str, password: Optional[str] = None):
baseurl = f"https://{ip_address}:7443/rest/v1"
config = Configuration() # <--- BUG IS HERE: Creates new config, ignoring user's config
config.host = baseurl
Because of this, it is impossible to pass verify_ssl=False into the StorageVirtualizeAPI.
Steps to reproduce and code
Attempt to run the following standalone script:
import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="openapi_client")
from openapi_client.configuration import Configuration
from openapi_client.api.storage_virtualize_api import StorageVirtualizeAPI
config = Configuration()
config.host = "https://<YOUR_IP>:7443/rest/v1"
config.verify_ssl = False
client = StorageVirtualizeAPI(
ip_address="<YOUR_IP>",
username_or_token="<USERNAME>",
password="<PASSWORD>"
)
result = client.svc_info_api.lshost_post()
print(result)
Errors
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='<YOUR_IP>', port=7443): Max retries exceeded with url: /rest/v1/auth (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1032)')))
- Ngôn ngữ chính
- Python
- Star
- 2
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anthropics/skills#1811 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
speaches-ai/speaches#678 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
datalayer/mcp-compose#42 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
conda-forge/spacy-feedstock#177 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
UKGovernmentBEIS/inspect_evals#2523 ·