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
Member

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

@nateberkopec nateberkopec added maintenance waiting-for-review Waiting on review from anyone labels Sep 21, 2020
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}")
Copy link
Member

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}?

Copy link
Member Author

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

Copy link
Member Author

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.

@nateberkopec nateberkopec mentioned this pull request Sep 22, 2020
8 tasks
@nateberkopec nateberkopec added waiting-for-changes Waiting on changes from the requestor and removed waiting-for-review Waiting on review from anyone labels Sep 22, 2020
MSP-Greg and others added 2 commits September 22, 2020 11:21
… (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>
@nateberkopec nateberkopec added waiting-for-review Waiting on review from anyone and removed waiting-for-changes Waiting on changes from the requestor labels Sep 23, 2020
@nateberkopec nateberkopec merged commit e041d07 into puma:master Sep 23, 2020
@nateberkopec
Copy link
Member

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

@ocowchun
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance waiting-for-review Waiting on review from anyone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Puma throwing "Transport endpoint is not connected" errors over and over.
3 participants