genotrance / px

An HTTP proxy server to automatically authenticate through an NTLM proxy
MIT License
952 stars 98 forks source link

Debug output showsstrange characters and some requests don't seem to return. #155

Closed halloleo closed 2 years ago

halloleo commented 2 years ago

I'm using now 0.8.2 and simple request with the curl cli work fine, but I plugged the proxy into PyCharm to get plugins listed and installed from the Jetbrains servers, but this is very flaky: Listing plugins somewhat works, but installing them never returns. (On another machine with direct internet access I don't have these problems.)

The debug output has strange characters in it:

.
.
.
MainProcess: Thread_1: 1656486164: /perform/_socket_action/_debug_callback: ed366c047cc2c2c6bd18ca45051d2d3acd0d8325: Curl info: Found bundle for host plugins.jetbrains.com: 0x7f6eb4010de0
MainProcess: Thread_1: 1656486164: /perform/_socket_action/_debug_callback: ed366c047cc2c2c6bd18ca45051d2d3acd0d8325: Curl info: Re-using existing connection! (#10) with host 192.168.80.81
MainProcess: Thread_1: 1656486164: /perform/_socket_action/_debug_callback: ed366c047cc2c2c6bd18ca45051d2d3acd0d8325: Curl info: Connected to 192.168.80.81 (192.168.80.81) port 3129 (#10)
MainProcess: Thread_1: 1656486164: /perform/_socket_action/_debug_callback: ed366c047cc2c2c6bd18ca45051d2d3acd0d8325: Curl info: Connection #10 to host 192.168.80.81 left intact
MainProcess: Thread_1: 1656486164: /handle_one_request/do_CONNECT/do_curl: ed366c047cc2c2c6bd18ca45051d2d3acd0d8325: SSL connected
MainProcess: Thread_1: 1656486164: /send_response/log_request/log_message: "CONNECT plugins.jetbrains.com:443 HTTP/1.1" 200 -
MainProcess: Thread_1: 1656486164: /do_CONNECT/do_curl/select: ed366c047cc2c2c6bd18ca45051d2d3acd0d8325: unable to reuse SSL connection with libcurl < v7.45
MainProcess: Thread_1: 1656486164: /do_curl/remove/_remove_handle: ed366c047cc2c2c6bd18ca45051d2d3acd0d8325: Remove handle:
MainProcess: Thread_1: 1656486164: /send_error/log_error/log_message: code 400, message Bad request version ('v\x826\x8b\x17ÜìlË.É+_\x03Fåâi¨^\x9b\x82Ïí\x8a¶\x9d\x00Z\x13\x01\x13\x02À,À+À0\x00\x9dÀ.À2\x00\x9f\x00£À/\x00\x9cÀ-À1\x00\x9e\x00¢À$À(\x00=À&À*\x00k\x00jÀ')
MainProcess: Thread_1: 1656486164: /send_response/log_request/log_message: "��?�ð�
~E�°Ïp§j�90ËxáöxZó�Î*N]ß¹ �ÆyÖ  v�6�ÜìlË.É+_Fåâi¨^��Ïí�¶�ZÀ,À+À0�À.À2�£À/�À-À1�¢À$À(=À&À*kjÀ" 400 -
MainProcess: Thread_3: 1656486177: /do_CONNECT/do_curl/select: fb532299c3f206b470da0e18c4d31999415c51d8: Server connection timeout
MainProcess: Thread_3: 1656486177: /do_CONNECT/do_curl/select: fb532299c3f206b470da0e18c4d31999415c51d8: 8392 bytes read, 8392 bytes written
MainProcess: Thread_3: 1656486177: /do_curl/remove/_remove_handle: fb532299c3f206b470da0e18c4d31999415c51d8: Remove handle:
MainProcess: Thread_3: 1656486197: /handle_one_request/log_error/log_message: Request timed out: timeout('timed out')
.
.
.

Some additional info:

px-proxy and PyCharm run on the same Linux machine (RHEL 7.9). px-proxy is in its own virtual env. PyCharm renders via X to another machine.

How can I provide more details for this?

genotrance commented 2 years ago

I'll look into the code, meanwhile, can you try upgrading curl > v7.45 to see if it helps? You can get Px to use a different curl by setting LD_LIBRARY_PATH.

halloleo commented 2 years ago

Hi @genotrance

Thanks for looking into this!

  1. I have upgraded to 0.8.2 and now the PyCharm store works with px-proxy! :) Thanks heaps!

  2. Re trying it with libcurl > v7.45: I cannot uninstall the old system version of libcurl (obviously, the whole system relies on it). So, how can I just download a newer libcurl? I tried the download configurator on curl.se (https://curl.se/dlwiz/), but didn't get anywhere...)

genotrance commented 2 years ago

No worries on retrying - if it works now then we can leave as is. A newer curl will be faster since SSL connections can be reused but doubt it will be a perceptible improvement.