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

Cylc UI Server does not accept SSL connections #215

Closed
kinow opened this issue May 6, 2021 · 3 comments
Closed

Cylc UI Server does not accept SSL connections #215

kinow opened this issue May 6, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@kinow
Copy link
Member

kinow commented May 6, 2021

Describe the bug

Tested the internal SSL today (cc @dpmatthews). Enabling SSL in the hub was pretty simple and worked.

# file: config.py
c.UIServer.ui_build_dir = '~/Development/python/workspace/cylc-ui/dist'  # path to build

c.Application.log_level = 'DEBUG'

# > cd ~/.cylc/hub/
# > openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out kinow.crt -keyout kinow.key

c.JupyterHub.ssl_key = '/home/kinow/.cylc/hub/kinow.key'
c.JupyterHub.ssl_cert = '/home/kinow/.cylc/hub/kinow.crt'

But after enabling internal SSL

c.JupyterHub.internal_ssl = True

I confirmed the proxy appeared to be using the internal SSL setting. The Cylc UIS was initialized, but it timed out.

Release version(s) and/or repository branch(es) affected?

master

Steps to reproduce the bug

Try enabling internal SSL.

Expected behavior

Everything works the same way as with no SSL.

Screenshots

Additional context

The reason the error is happening, I believe, is that our application is a normal traitlet application.

We probably need to use SingleUserNotebookAppMixin or copy just the trailet parts where it's loading the SSL settings (@oliver-sanders see the part about the hub-prefix and other settings that are ignored in Cylc UIS, I think that's related to #213).

Doing so would define these settings in the Application initialized by Cylc UIS. Then, we would need to stop calling app.listen(...) which just initiates a simple Tornado HttpServer, and call launch_instance in the SingleUserNotebookAppMixin parent (or just implement the code that creates the Tornado ssl_options).

With that done, I believe the handshake between Hub/spawner and the Cylc UIS should work, and internal SSL will work (:crossed_fingers: )

Pull requests welcome!
This is an Open Source project - please consider contributing a bug fix
yourself (please read CONTRIBUTING.md before starting any work though).

@kinow kinow added the bug Something isn't working label May 6, 2021
@kinow kinow added this to the cylc-uiserver 1.0.0 milestone May 6, 2021
@kinow
Copy link
Member Author

kinow commented May 6, 2021

Found my old branch from Jan 2020 where I tried internal SSL with Cylc UIS: https://github.com/kinow/cylc-uiserver/commits/try-ssl-internal-1

@oliver-sanders
Copy link
Member

Bumping the milestone, I think we can close this with the jupyter_server PR.

@oliver-sanders
Copy link
Member

Closed by #230.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants