0

How can I configure Jupyterhub to work with chain certificates? I have my certs from Entrust:

my_name.txt

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

Entrust_Root.txt

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

Entrust_L1Kroot.txt

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

When I try to start Jupyterhub I get following error:

crypto.js:131

c.context.setKey(options.key);
          ^

Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
at Object.exports.createCredentials (crypto.js:131:17)
at Server (tls.js:1128:28)
at new Server (https.js:35:14)
at Object.exports.createServer (https.js:54:10)
at new ConfigurableProxy (/usr/lib/node_modules/configurable-http-proxy/lib/configproxy.js:158:35)
at Object. (/usr/lib/node_modules/configurable-http-proxy/bin/configurable-http-proxy:171:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
[C 2016-05-13 15:44:24.633 JupyterHub app:1119] Failed to start proxy
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/jupyterhub/app.py", line 1117, in start
yield self.start_proxy()
File "/usr/local/lib/python3.5/site-packages/jupyterhub/app.py", line 881, in start_proxy
_check()
File "/usr/local/lib/python3.5/site-packages/jupyterhub/app.py", line 877, in _check
raise e
RuntimeError: Proxy failed to start with exit code 8

My confiuration file:

c.JupyterHub.ssl_cert = u'/path/to/Entrust_L1Kroot.txt'
c.JupyterHub.ssl_key = u'/path/to/my_name.txt'

I have tried other assignments to the ssl_cert and ssl_key but they did not work neighter.

lmtx
  • 5,018
  • 3
  • 20
  • 29

2 Answers2

0

To prepare the full chain of certificates you need to concatenate all of them to single file:

cat your_name.txt Entrust_L1Kroot.txt Entrust_Root.txt > your_name-chained.crt

Then configure JupyterHUB:

c.JupyterHub.ssl_cert = '/path/to/your_name-chained.crt'
c.JupyterHub.ssl_key = '/path/to/my_name.key'
lmtx
  • 5,018
  • 3
  • 20
  • 29
0

You can generate your - self-signed SSL certificate for jupyterhub e.g. - if you are using localhost (or without a real domain)

openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout jupyterhub.key -out jupyterhub.crt
InLaw
  • 2,537
  • 2
  • 21
  • 33