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

Open Beginner friendly
#1 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
api

Research direction

Start in openapi_client/api/storage_virtualize_api.py at the init code around line 53, then compare it with the README Troubleshooting section and the Configuration usage in the reproduction script. Run the standalone example against an environment with a self-signed certificate; done means the wrapper honors verify_ssl=False instead of raising the certificate verification error.

Written by the indexing model from the issue text.

Description

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)')))
Dominant language
Python
Stars
2
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from IBM/IBMStorageVirtualizeRestAPI

All issues in IBM/IBMStorageVirtualizeRestAPI

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.