Skip to content

Cylc UI Server does not accept SSL connectionsΒ #215

@kinow

Description

@kinow

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions