`StorageVirtualizeAPI` constructor ignores `Configuration` object, making it impossible to disable SSL
まだ誰も着手していません。
評価
調査の方向性
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 はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100