-
Notifications
You must be signed in to change notification settings - Fork 47
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
Check result of ThousandIsland.Socket.handshake/1
#10
Conversation
Great PR! I can't believe I missed that in my original workup. A couple of requests in advance of merging:
|
9dccc45
to
5954369
Compare
I also think that the typespec for Socket.handshake is incorrect? It specifies something like {:error, String.t()}, however, looking at the erlang docs for handshake() it defines the return value as :ssl.reason(), which is in turn defined as: closed | timeout | error_alert() I'm wondering if we should use :ssl.reason() or any(), since arguably it's overrideable by a custom transport? Opinion? |
The SSL module has some odd bits in its typespecs, and if memory serves I think I took a bit of a shortcut there and just punted on the error tuple spec. If you want to sort them all out and tighten up our public spec @ewildgoose that would be very welcome work. So long as dialyzer passes I'm happy. |
@mtrudel Do you have any other ideas how to extract the error value from a single failing handler? |
Okay, I think I found an acceptable solution by sending the error result to the test process and checking it via |
Solution looks good! Just waiting on CI. |
Added a check for the
ThousandIsland.Socket.handshake/1
return value, in case it fails (e.g. if the path to the tls cert is messed up).PS: Sorry for the many changes, but my editor removed the whitespaces at the end of the lines.
The real change is just the
case
statement at the bottom.