Tuesday, August 20, 2013

Apache Hadoop - How to enable HTTPS in Hue



You can configure Hue to serve over HTTPS. To do so, you must install "pyOpenSSL" within Hue’s context and configure your keys. I tried normal openssl command on my Hue server, but the generate key and certifiacte didn't work for me, I had to use pyOpenSSL (Python wrapper around a small subset of the OpenSSL library. Includes: X509 Certificates, SSL Context objects, SSL Connection objects using Python sockets as transport layer.).

OS: CentOS 6.x

# yum install pyOpenSSL
# Create a key
# openssl genrsa 1024 > host.key
# Create a self-signed certificate
# openssl req -new -x509 -nodes -sha1 -key host.key > host.cert

Configure Hue to use your private key by adding the following options to the /etc/hue/hue.ini configuration file:

ssl_certificate=/path/to/certificate
ssl_private_key=/path/to/key

For Cloudera manager users, go to "Services" -> "hue1" -> "Configuration" -> "Hue Server (Default)" -> "Enable HTTPS", "ssl_certificate" and "ssl_private_key".

4 comments:

Unknown said...

Great post and depending on your Hue version pyOpenSSL should be already included in Hue: https://issues.cloudera.org/browse/HUE-902

Unknown said...

Great post and depending on your Hue version pyOpenSSL should be already included in Hue: https://issues.cloudera.org/browse/HUE-902

abec said...

Awesome job describing the process of creating a self signed certificate and configuring it in Hue :).

Tony Li Xu said...

Tks Romain for the comment, good to know that.