Skip to content

SSL access through a proxy causes SIGSEGV #1533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

yosh-matsuda
Copy link
Contributor

I've found that GET requests via proxy cause SIGSEGV for SSL access.

@yhirose Could you review the following and the PR?

How to reproduce

OS: Ubuntu 22.04.2 (x86_64)

Set up Squid.

$ docker run -d --name squid-container -e TZ=JST -p 3128:3128 ubuntu/squid:5.2-22.04_beta

Code to reproduce.

Client cli("https://www.yahoo.com");
cli.set_proxy("localhost", 3128);
auto res = cli.Get("/");

Detail

It seems that the problem is originated in the commit c7e959a at the ClientImpl::process_request function. I don't understand the implementation details around that code, but it is probably due to the lack of a socket open check, and this seems to fix SIGSEGV.

@yosh-matsuda yosh-matsuda changed the title Fix to check if socket is open SSL access through a proxy causes SIGSEGV Mar 25, 2023
@yhirose yhirose closed this in f4b02df Mar 26, 2023
@yhirose
Copy link
Owner

yhirose commented Mar 26, 2023

@yosh-matsuda thanks for the bug report and pull request. I tested it on my Mac and this pull request didn't fix the crash on macOS at f4b02df. I fixed it in a different way, and confirmed that it now fixes the problem on macOS. Could you test it on your linux environment? Then, I'll bump up the version number.
Thanks for your help!

@yosh-matsuda
Copy link
Contributor Author

@yhirose Thank you very much. It works fine on my Ubuntu.

@yosh-matsuda yosh-matsuda deleted the fix-ssl-via-proxy branch March 26, 2023 01:40
@yhirose
Copy link
Owner

yhirose commented Mar 26, 2023

@yosh-matsuda this fix is included in v0.12.2. Thanks for your fine contribution. 👍

ExclusiveOrange pushed a commit to ExclusiveOrange/cpp-httplib-exor that referenced this pull request May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants