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
Change Events#ssl_error signature from (error, peeraddr, peercert) to (error, ssl_socket) #2375
Conversation
def ssl_error(error, peeraddr, peercert) | ||
def ssl_error(error, ssl_socket) | ||
addr = ssl_socket.peeraddr.last rescue "<unknown>" | ||
peercert = ssl_socket.peercert | ||
subject = peercert ? peercert.subject : nil | ||
@error_logger.info(error: error, text: "SSL error, peer: #{peeraddr}, peer cert: #{subject}") |
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.
peeraddr is undefined. did you mean to change this line to peer: #{addr}
?
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.
You're being too nice. Actually, I'm changing addr
on line 113 to peeraddr
. More importantly, I'm adding a test (bad assumption on my part). Give me a minute...
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.
Fixed and added a test. Thanks.
… (error, ssl_socket) The method signature should include the socket, so it determines what socket info is logged Co-authored-by: ocowchun <ocowchun@gmail.com>
4633725
to
c244fb7
Compare
Nice to see @ocowchun on the co-author there, nice touch. Co-authoring is underused! |
Haha, Thanks, but I don't think I deserve the credit. Still, I wish I can have more contribution to puma in the future. |
Description
The method signature should include the socket, so it determines what socket info is logged, and also so it can catch exceptions.
Closes #2335, closes #2367
Your checklist for this pull request
[changelog skip]
or[ci skip]
to the pull request title.[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.