Create and Apply SSL Certificate to OpenWRT LuCI Web Interface

Channel:
Subscribers:
14,900
Published on ● Video Link: https://www.youtube.com/watch?v=pjI1YY1oV6w



Duration: 3:34
665 views
17


#OpenWRT #SSL #HTTPS

Full steps can be found at https://i12bretro.github.io/tutorials/0382.html

--------------------------------------------------------------------
Prerequisites
--------------------------------------------------------------------
   - A XCA PKI database  https://youtu.be/ezzj3x207lQ
 
--------------------------------------------------------------------
Create Your SSL Certificate
--------------------------------------------------------------------
   01. Launch XCA
   02. Open the PKI database if it is not already (File ≫ Open DataBase), enter password
   03. Click on the Certificates tab, right click on your Intermediate CA certificate
   04. Select New
   05. On the Source tab, make sure Use this Certificate for signing is selected
   06. Verify your Intermediate CA certificate is selected from the drop down
   07. Click the Subject tab
   08. Complete the Distinguished Name section
         internalName: openwrt.i12bretro.local
         countryName: US
         stateOrProvinceName: Virginia
         localityName: Northern
         organizationName: i12bretro
         organizationUnitName: i12bretro Certificate Authority
         commonName: openwrt.i12bretro.local
   09. Click the Generate a New Key button
   10. Enter a name and set the key size to at least 2048
   11. Click Create
   12. Click on the Extensions tab
   13. Select End Entity from the type list
   14. Click Edit next to Subject Alternative Name
   15. Add any DNS or IP addresses that the certificate will identify
   16. Update the validity dates to fit your needs
   17. Click the Key Usage tab
   18. Under Key Usage select Digital Signature, Key Encipherment
   19. Under Extended Key Usage select Web Server and Web Client Authentication
   20. Click the Netscape tab
   21. Select SSL Server
   22. Click OK to create the certificate
 
--------------------------------------------------------------------
Exporting Required Files
--------------------------------------------------------------------
   01. In XCA, click on the Certificates tab
   02. Right click the SSL certificate ≫ Export ≫ File
   03. Set the file name to uhttpd.crt verify the export format is PEM (*.crt)
   04. Click OK
   05. Click the Private Keys tab
   06. Right click the private key generated for the SSL certificate ≫ Export ≫ File
   07. Set the file name to uhttpd.key and verify the export format is PEM private (*.pem)
   08. Click OK
 
--------------------------------------------------------------------
Installing Prerequisites
--------------------------------------------------------------------
   01. Log into OpenWRT via SSH
   02. Run the following commands to install prerequisites
         # update opkg packages
         opkg update
         # install prerequisite packages
         opkg install luci-lib-px5g px5g-standalone libustream-openssl
         # install/update luci
         opkg install luci
         # restart uhttpd service
         /etc/init.d/uhttpd restart
   03. Download WinSCP  https://winscp.net/eng/downloads.php
   04. Extract WinSCP and run the executable
   05. Connect to the OpenWRT IP address via WinSCP
   06. Navigate to /etc
   07. Rename uhttpd.crt and uhttpd.key to .old
   08. Copy the created uhttpd.crt and uhttpd.key to /etc
   09. Back in the terminal, run the following command to restart uhttpd
         /etc/init.d/uhttpd restart
 
--------------------------------------------------------------------
Applying SSL Certificates in Open-WRT
--------------------------------------------------------------------
   01. Open a web browser and navigate to https://OpenWRT_IP
   02. Authenticate at the Open-WRT login
   03. Select System ≫ System from the top navigation
   04. Set the hostname to match the hostname of the SSL certificate
   05. Click the Save & Apply button
 
Source: https://fabianlee.org/2016/09/19/openwrt-enabling-https-for-the-luci-web-admin-interface/
 


### Connect with me and others ###
★ Discord: https://discord.com/invite/EzenvmSHW8
★ Reddit: https://reddit.com/r/i12bretro
★ Twitter: https://twitter.com/i12bretro







Tags:
Apply SSL Certificates To LuCI
Apply SSL Certificates To OpenWRT
Certificates
HTTPS
HTTPS OpenWRT Web Interface
Home Lab
Home Lab Ideas
Home Networking
Homelab
Homelab Ideas
How To
Linux
LuCI
Network
Networking
OpenWRT
PKI
Router
SSL
Tutorial
Virtual Router
i12bretro