SUSE Support

Here When You Need Us

Curl error: Unsupported proxy syntax

This document (000021433) is provided subject to the disclaimer at the end of this document.

Situation

The system has a proxy enabled. When executing a curl command, the following error message is displayed:
url: (5) Unsupported proxy syntax in '127.0.0.1:8899

Resolution

Check the proxy configuration file (/etc/sysconfig/proxy) and the proxy environment variables for syntax errors.

Some characters might not be easily visible on the terminal. Consider making a hex dump of the proxy environment variables for better visibility:
echo "$http_proxy" | xxd
00000000: 3132 372e 302e 302e 313a 3838 3939 0d0a  127.0.0.1:8899..

echo "$https_proxy" | xxd
00000000: 3132 372e 302e 302e 313a 3838 3939 0d0a  127.0.0.1:8899..

In this example, both the http_proxy and https_proxy environment variables contain an extra 0d (\r or carriage return).  Carriage return is a line delimiter used in DOS/Windows ASCII text, but not in Linux or Unix.

Carriage returns can be removed from a file with the command:
dos2unix <filename>

Unexpected characters can also be manually removed with the backspace or delete keys, even if you cannot see them.  A full line can be deleted and retyped.
 

Cause

The cause of this issue is an invalid syntax in the proxy string.

Additional Information

Reference:
* https://www.suse.com/support/kb/doc/?id=000017441
* man curl

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021433
  • Creation Date: 18-Apr-2024
  • Modified Date:19-Apr-2024
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.