Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Received HTTP code 501 from proxy after CONNECT

Whenever I try to clone a repository from bitbucket, it gives me following error:

fatal: unable to access 'https://[email protected]/user_name/repo_name.git/': Received HTTP code 501 from proxy after CONNECT

Can't understand what is the problem. I am copying git clone command from bitbucket repository web. I have also set git http.proxy but it didn't work.

Let me know if more information is required.

Thanks

like image 378
Faizan Mubasher Avatar asked Feb 08 '17 06:02

Faizan Mubasher


People also ask

What is a 501 HTTP error?

A 501 HTTP isn’t a problem with your computer or web browser. It’s a problem with the web server or the site running on it. Most errors occur when the owner of a web server hasn't enabled a feature needed to complete a server request.

Does my proxy server support HTTP CONNECT tunneling?

Obviously, your proxy doesn't support HTTP CONNECT tunneling, that's why it responds with HTTP 501 (Not implemented) code: A variation of HTTP tunneling when behind an HTTP Proxy Server is to use the "CONNECT" HTTP method.

What are HTTP proxy errors and how to fix them?

The main types of HTTP proxy errors are 4xx and 5xx error codes. Receiving an error from the 4xx series indicates that the problem is from the client-side. It can be your request, browser, or the automation bot. It is a generic response indicating that there’s a problem with your sent request.

Why did I get a 501(c)(1) return from a server?

Sometimes a 501 is returned when a server has an unprecedented amount of traffic. Maybe you got a link that made it to a popular community on Reddit, and your site is slammed from the bump. Perhaps you’re the target of a DDoS attack.


1 Answers

Obviously, your proxy doesn't support HTTP CONNECT tunneling, that's why it responds with HTTP 501 (Not implemented) code:

HTTP CONNECT tunneling

A variation of HTTP tunneling when behind an HTTP Proxy Server is to use the "CONNECT" HTTP method.

In this mechanism, the client asks an HTTP Proxy server to forward the TCP connecting to the desired destination. The server then proceeds to make the connection on behalf of the client. Once the connection has been established by the server, the Proxy server continues to proxy the TCP stream to and from the client. Note that only the initial connection request is HTTP - after that, the server simply proxies the established TCP connection.

This mechanism is how a client behind an HTTP proxy can access websites using SSL (i.e. HTTPS).

Not all HTTP Proxy Servers support this feature, and even those that do, may limit the behaviour (for example only allowing connections to the default HTTPS port 443, or blocking traffic which doesn't appear to be SSL).

like image 159
Leon Avatar answered Nov 15 '22 07:11

Leon