-
Notifications
You must be signed in to change notification settings - Fork 23
Create and Import the CA Certificate
pixelserv-tls requires a CA cert to serve requests over HTTPS. Assume OpenSSL already installed in your system.
sudo mkdir -p /var/cache/pixelserv
cd /var/cache/pixelserv
sudo openssl genrsa -out ca.key 1024
sudo openssl req -key ca.key -new -x509 -days 3650 -sha256 -extensions v3_ca -out ca.crt -subj "/CN=Pixelserv CA"
sudo chown -R nobody /var/cache/pixelserv
mkdir -p /opt/var/cache/pixelserv
cd /opt/var/cache/pixelserv
openssl genrsa -out ca.key 1024
openssl req -key ca.key -new -x509 -days 3650 -sha256 -extensions v3_ca -out ca.crt -subj "/CN=Pixelserv CA"
chown -R nobody /opt/var/cache/pixelserv
This creates a CA cert with 1024-bit key strength valid for ten years. Let's call it your Pixelserv CA cert, unique to and solely owned by you. Only you possess the private key as stored in ca.key
.
CAUTION
You may want to backup ca.crt
and ca.key
. This will save you from generating and importing a new CA cert on client devices in the event that the original CA cert files in /opt/var/cache/pixelserv
are damaged.
Importing your CA cert on clients is not mandatory but recommended. Your Pixelserv CA cert is available through URL http://pixelserv ip/ca.crt
. Make sure you replace pixelserv ip
with the actual IP address of pixelserv.
The following procedure will import your CA cert and trust it system wide.
- Open Safari/Chrome. Visit
http://pixelserv ip/ca.crt
. Make sure you replacepixelserv ip
with the actual IP address of pixelserv. - Follow the prompt to finish the installation.
CAUTION
Since iOS 10.3, a user-installed CA cert requires enabling trust explicitly.
- Go to
Settings > General About > Certificate Trust Settings
. - Under
Enable full trust for root certificates
, turn on trust for Pixelserv CA.
This tip is provided by @jrmwvu04 on snbforums.
Firefox manages its own root CA certificates. The import procedure is same on all platforms.
- Open your browser and visit
http://pixelserv ip/ca.crt
. Make sure you replacepixelserv ip
with the actual IP address of pixelserv. - Select "Trust this CA to identify websites" on the screen pop-up.
- Click "Ok"
The following procedure will import your CA cert and trust it system wide.
- Open Safari/Chrome. Visit
http://pixelserv ip/ca.crt
. Make sure you replacepixelserv ip
with the actual IP address of pixelserv. - Find the downloaded file,
ca.crt
. - Double click on `ca.crt' to start Keychain's import wizard.
- Select keychain "system" and click "Add".
- Open Keychain Access and select keychain "System".
- Locate "Pixelserv CA" and double click to the CA cert.
- Expand "Trust" and select "Always Trust" for "When using this certificate"
- Close the window to finish setting update.
Restart your browser to take effect.
The follow procedure will import your CA cert and trust it system wide.
- Open your browser. Visit
http://pixelserv ip/ca.crt
. Make sure you replacepixelserv ip
with the actual IP address of pixelserv. - Find the downloaded file,
ca.crt
. - Double click on `ca.crt' to view the certificate.
- Click "Install Certificate.." and select "Local Machine".
- Click "Place all certificate in the following store" on next screen.
- Click "Browse..." and select "Trusted Root Certification Authorities".
- Click "Next" and then "Finish" on next screen.
Restart browser to take effect.
If the above steps do not work for you, please follow this Windows guide to use MMC for import.
You may follow this guide for ChromeOS, and this one for Linux in general.