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

http: Skip hostname validation for OpenSSL < 1.0.2 #15

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

ac000
Copy link
Contributor

@ac000 ac000 commented Apr 15, 2020

Hi,

ff-proxy is using some OpenSSL functions that were only introduced in 1.0.2, these are for doing hostname validation, While it can be done in OpenSSL prior ro 1.0.2, it's quite convoluted0

For this use case it's perhaps better to just skip it with OpenSSL older than 1.0.2

Hopefully this is the last of fixes needed for #9 (famous last words!).

Cheers,
Andrew

@TimeToogo
Copy link
Owner

I don't think silently omitting host name validation is a good idea. Even if the host doesn't have an OpenSSL version which supports it out of the box we shouldn't ignore origin host authentication since it leaves the implementation vulnerable to MITM attacks.

I'd suggest adding an explicit compile-time flag such as SKIP_ORIGIN_AUTHENTICATION=1 or the like.

When compiling with OpenSSL prior to 1.0.2 the following errors are
produced

src/http.c:280:5: warning: implicit declaration of function 'SSL_get0_param' [-Wimplicit-function-declaration]
...
src/http.c:281:5: warning: implicit declaration of function 'X509_VERIFY_PARAM_set1_host' [-Wimplicit-function-declaration]

These functions were only added in OpenSSL 1.0.2

Doing hostname validation prior to OpenSSL 1.0.2 is somewhat
convoluted[0], for this use case it's perhaps better to allow it to be
skipped when using OpenSSL older than 1.0.2

Add a check in the Makefile for the OpenSSL version and halt the build
and print a message saying what to do in such cases. E.g

    $ make
    ***
    *** OpenSSL too old (< 1.0.2)
    ***
    *** If you are OK with skipping hostname validation then please build with
    ***
    *** make OPENSSL_SKIP_HOST_VALIDATION=1
    ***
    make: *** [Makefile:39: build_check] Error 1

this way the user is fully aware of what is happening...

[0]: https://wiki.openssl.org/index.php/Hostname_validation
@ac000
Copy link
Contributor Author

ac000 commented Apr 15, 2020

Fair enough.

I've changed it so that we do a check in the Makefile and halt the build and print a message saying what to do when using OpenSSL < 1.0.2.

Cheers,
Andrew

@TimeToogo TimeToogo merged commit 5f9dd3f into TimeToogo:master Apr 15, 2020
@TimeToogo
Copy link
Owner

Looks good, thanks!

@ac000 ac000 deleted the skip_validate_host branch April 30, 2020 23:47
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