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

Change Events#ssl_error signature from (error, peeraddr, peercert) to (error, ssl_socket) #2375

Merged
merged 3 commits into from Sep 23, 2020

Conversation

@MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented Sep 20, 2020

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

  • I have reviewed the guidelines for contributing to this repository.
  • I have added an entry to History.md if this PR fixes a bug or adds a feature. If it doesn't need an entry to HISTORY.md, I have added [changelog skip] or [ci skip] to the pull request title.
  • I have added appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.
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}")

This comment has been minimized.

@nateberkopec

nateberkopec Sep 22, 2020
Member

peeraddr is undefined. did you mean to change this line to peer: #{addr}?

This comment has been minimized.

@MSP-Greg

MSP-Greg Sep 22, 2020
Author Contributor

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...

This comment has been minimized.

@MSP-Greg

MSP-Greg Sep 22, 2020
Author Contributor

Fixed and added a test. Thanks.

@nateberkopec nateberkopec mentioned this pull request Sep 22, 2020
4 of 8 tasks complete
MSP-Greg and others added 2 commits Sep 20, 2020
… (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>
@MSP-Greg MSP-Greg force-pushed the MSP-Greg:events-ssl-error branch from 4633725 to c244fb7 Sep 22, 2020
@nateberkopec nateberkopec merged commit e041d07 into puma:master Sep 23, 2020
@nateberkopec
Copy link
Member

@nateberkopec nateberkopec commented Sep 23, 2020

Nice to see @ocowchun on the co-author there, nice touch. Co-authoring is underused!

@ocowchun
Copy link
Contributor

@ocowchun ocowchun commented Sep 23, 2020

Haha, Thanks, but I don't think I deserve the credit. Still, I wish I can have more contribution to puma in the future.

@MSP-Greg MSP-Greg deleted the MSP-Greg:events-ssl-error branch Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.