Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#1 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
api

调研方向

从 openapi_client/api/storage_virtualize_api.py 中第 53 行附近的 init 代码开始,然后将其与 README 的 Troubleshooting 部分以及复现脚本中 Configuration 的用法进行比较。在具有自签名证书的环境中运行独立示例;完成标准是 wrapper 遵循 verify_ssl=False,而不是引发证书验证错误。

由索引模型根据 Issue 内容生成。

描述

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)')))
主要语言
Python
星标
2
派生
2
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。