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

examples: require good code to show how to support both secure and insecure connections #776

Open
barsnick opened this issue Nov 30, 2018 · 1 comment

Comments

@barsnick
Copy link

An mentioned in #597, #706 and #745, the example clients could make use of good code to show how to support both secure (wss://) and insecure (ws://) from the same implementation. I'll try to make this ticket "meta" (excuse me if it disturbs the flow.)

@barsnick
Copy link
Author

I chose to work with the debug_client example, which was already made to be switched between the two by changing only a few lines of code. I managed to make it work with both, with as much common code as possible, by using templates.

It's not a complete example, and it doesn't even work for the given echo server, as you will see in the commit message of the pull request:

This change does not cover proper configuration of the TLS connection. A proper implementation requires more code for choice of protocols, verification of certificates, and so on.

Most notably, the given default URI wss://echo.websocket.org currently does not even work with this example, because it makes use of a wildcard certificate. This requires more asio boilerplate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant