The Wayback Machine - https://web.archive.org/web/20200603191307/https://github.com/IncludeSecurity/safeurl-python/issues/2
Skip to content
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

Add address check inside OPENSOCKET callback #2

Open
JordanMilne opened this issue Aug 23, 2016 · 0 comments · May be fixed by #3
Open

Add address check inside OPENSOCKET callback #2

JordanMilne opened this issue Aug 23, 2016 · 0 comments · May be fixed by #3

Comments

@JordanMilne
Copy link

@JordanMilne JordanMilne commented Aug 23, 2016

pycurl has a hook that can run whenever a socket is opened, with one of the parameters being the resolved IP of the address to connect to (at least according to this unit test.)

If you check the address passed into the callback against the IP whitelist / blacklist you should be able to get rid of the manual DNS pinning, resolving your problems with the CN validation failing with HTTPS.

Unfortunately this callback isn't exposed in PHP so it can't be used in safeurl-php.

JordanMilne added a commit to JordanMilne/safeurl-python that referenced this issue Oct 26, 2016
Fixes IncludeSecurity#2.

Instead of rewriting the hostname to be the IP address, instead we
look at the resolved IP just before cURL opens the socket. This is
fine since cURL's connection pools are per-handle so we don't have
to worry about keep-alive and other handles' connections.

This negates the need for DNS pinning, so enabling DNS pinning is
now effectively a no-op.
@JordanMilne JordanMilne linked a pull request that will close this issue Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.