-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support localhost
integration in ssl_bind
#2711
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! Agreed with all @dentarg's points and added a few of my own.
@nateberkopec @dentarg It still needs some additional tests to be added (I only tested it on my local example-apps) |
@ios[ios_len..-1].each do |i| | ||
addr = loc_addr_str i | ||
logger.log "* #{log_msg} on ssl://#{addr}?#{uri.query}" | ||
logger.log "* #{log_msg} on ssl://#{addr}?#{uri_query}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this? Looks to me like uri.query
is still available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So uri.query
as uri
comes from
Lines 66 to 67 in 20dc923
"ssl://#{host}:#{port}?cert=#{opts[:cert]}&key=#{opts[:key]}" \ | |
"#{ssl_cipher_filter}&verify_mode=#{verify}#{tls_str}#{ca_additions}#{v_flags}" |
key
and cert
values (&key=&cert=
).These empty values are transformed to Hash and stored in
params
variable here Line 230 in 20dc923
params = Util.parse_query uri.query |
params
is "enriched" by new values, thus I'm transforming it back from Hash to String
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end only
params
is "enriched" by new values
I think we should have a comment about this somewhere, to help future readers understand that directly (I didn't know either), maybe where uri_query
is defined or where params
is passed to MiniSSL::ContextBuilder.new
. WDYT?
Just mentioning this, not sure what we can do right now about it: there's another PR (#2728) changing code related to this, see https://github.com/puma/puma/pull/2728/files#diff-b771cc8da488f9700644eadd48510a23b1c2d5a7776dbc983eae1d2338536fd7. If I understand things correctly, with both these changes as-is, we would be logging cert_pem
and cert_key
if you are using the functionality added in #2728. I guess it would be up to the PR that's merged last to deal with that :) cc @dalibor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tests is the only thing it really needs 👍 |
1215cdf
to
1d3f775
Compare
localhost
integration in ssl_bind
Description
Hello, here is my attempt to fix #2708
Closes #2708
Your checklist for this pull request
[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.