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

fallback option is broken, second call to fallback crashes the SNIProxy with sniproxy SIGABRT, first call goes fine. #160

Closed
balyanrobin opened this issue Apr 2, 2015 · 7 comments

Comments

@balyanrobin
Copy link
Contributor

Hi,

Thanks for providing a great software to the community. I just downloaded the latest Sniproxy code and installed it. I noticed when the request goes to fallback domain it crashes in the second call. First call goes fine. Do you have any Idea?

Thanks i advance for your efforts and time.

Robin

@balyanrobin
Copy link
Contributor Author

When request does not include sin-extension/hostname, i see below errors in error.log first time and second time for the same call SniProxy crashes -

2015-04-02 07:53:05 Request from [::ffff:xx.xxx.xx.xx]:53536 did not include a hostname
2015-04-02 07:53:05 Invalid hostname (null) in client request

My configuration is below,
listen 443 {
protocol tls
table https_hosts
fallback localhost:8080
access_log {
# Same options as error_log
filename /logs/sni_https.log
priority debug
}
}

@dlundquist
Copy link
Owner

Could you try it with fallback 127.0.0.1:8080 instead of fallback localhost:8080?

@dlundquist
Copy link
Owner

I've added a test in 93af73a and have been been able to reproduce this behavior.

@balyanrobin
Copy link
Contributor Author

Ok great, Do you still want me to test 127.0.0.1 or you got the handle on the issue?

@dlundquist
Copy link
Owner

@balyanrobin I can't reproduce your crash. Using an IP literal rather than a hostname will allow the fallback server to to be used even if there is a problem resolving DNS queries. I've added a warning in the 0.4.0 release to discourage this configuration, although I could see certain applications where this could be useful so its only a warning. In the case of localhost, using ::1 or 127.0.0.1 is a good idea.

@balyanrobin
Copy link
Contributor Author

for me it is crashing even if i use IP literal also like : fallback 127.0.0.1:8080

@balyanrobin
Copy link
Contributor Author

below line in connection.c under resolve_server_address is destroying the fallback memory, and hurting the next connection falling back on the same fallback server. Could you please review it once

free(server_address);

dlundquist added a commit that referenced this issue Apr 8, 2015
Now listener_lookup_server_address() always returns a new allocation
or NULL. Thanks @balyanrobin for identifying this error.

Moved copy address logic into its own routine.

Fixes #160
Fixes #161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants