`StorageVirtualizeAPI` constructor ignores `Configuration` object, making it impossible to disable SSL
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IBM/IBMStorageVirtualizeRestAPI
-
security
Difficulty 3/5 1-2 days Newbie friendliness 50/100
All issues in IBM/IBMStorageVirtualizeRestAPI
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·