Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`StorageVirtualizeAPI` constructor ignores `Configuration` object, making it impossible to disable SSL

Đang mở Phù hợp với người mới
#1 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.