Skip to content

Fix typo in SSL error fallback URL slicing in filesender-cly.py #2506

@victoritis

Description

@victoritis

There is a typographical error in the filesender-cli.py script that causes it to fail when the --insecure flag is used and an initial SSL error occurs.

Problem: On line 215 (within the except requests.exceptions.SSLError block), the slicing used to construct the URL for filesender-config.js.php is base_url[1:-9].

If the base_url starts with https://, this slice removes the leading 'h', resulting in an invalid URL starting with ttps://. This leads to a requests.exceptions.InvalidSchema: No connection adapters were found for 'ttps://...' error.

Comparison:

Line 203 (Correct): config_response = requests.get(base_url[0:-9]+'/filesender-config.js.php',verify=True)
Line 215 (Incorrect): config_response = requests.get(base_url[1:-9]+'/filesender-config.js.php',verify=False)
Steps to reproduce:

Use filesender-cli.py against a server with a self-signed or invalid SSL certificate.
Provide the -i or --insecure flag.
The script will catch the SSLError, enter the elif insecure: block, and crash due to the malformed ttps:// URL.
Suggested Fix: Change the slicing on line 215 from [1:-9] to [0:-9] to match the logic used on line 203.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fix mergedA PR has been created and merged to help or address this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions