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

Catch getsslcontext errors in server listenloop #602

Merged
merged 4 commits into from
Oct 9, 2020
Merged

Catch getsslcontext errors in server listenloop #602

merged 4 commits into from
Oct 9, 2020

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Oct 9, 2020

Fixes #318. This is a bad bug. Basically, if you're running an ssl
server, any client who sends a non-perfect https request (like simply a
plain http request) would result in the server task throwing an error
and closing. This is partly because the thrown error isn't super
obvious, nested down a few calls in our overloaded
Sockets.accept(::Server{SSLConfig}) method. The fix proposed here is
that we'll put a try-catch in the ssl handshaking code and if an error
is thrown, we return nothing; in the server listenloop, if the
accepted io is nothing, then we'll skip and try to accept the next
connection.

Fixes #318. This is a bad bug. Basically, if you're running an ssl
server, any client who sends a non-perfect https request (like simply a
plain *http* request) would result in the server task throwing an error
and closing. This is partly because the thrown error isn't super
obvious, nested down a few calls in our overloaded
`Sockets.accept(::Server{SSLConfig})` method. The fix proposed here is
that we'll put a try-catch in the ssl handshaking code and if an error
is thrown, we return `nothing`; in the server `listenloop`, if the
accepted `io` is `nothing`, then we'll skip and try to accept the next
connection.
@quinnj quinnj mentioned this pull request Oct 9, 2020
@codecov-io
Copy link

codecov-io commented Oct 9, 2020

Codecov Report

Merging #602 into master will increase coverage by 0.39%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #602      +/-   ##
==========================================
+ Coverage   77.84%   78.23%   +0.39%     
==========================================
  Files          37       37              
  Lines        2433     2440       +7     
==========================================
+ Hits         1894     1909      +15     
+ Misses        539      531       -8     
Impacted Files Coverage Δ
src/Servers.jl 65.27% <100.00%> (+6.28%) ⬆️
src/ConnectionPool.jl 77.70% <0.00%> (-0.26%) ⬇️
src/URIs.jl 93.37% <0.00%> (ø)
src/Parsers.jl 97.91% <0.00%> (+0.02%) ⬆️
src/ConnectionRequest.jl 51.78% <0.00%> (+1.78%) ⬆️
src/IOExtras.jl 75.86% <0.00%> (+3.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3c7294...e995a3c. Read the comment docs.

@bauglir
Copy link

bauglir commented Oct 9, 2020

Thanks for fixing this @quinnj! Very much appreciated.

@quinnj quinnj merged commit aa4c058 into master Oct 9, 2020
@quinnj quinnj deleted the jq/318 branch October 9, 2020 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants