Running the Sample App with an Enterprise VPN or Next-Generation Firewall

Learn how to build the UR Encoder Browser Sample App when using an Enterprise VPN or Next-Generation Firewall.


Overview

To build the UR Encoder Browser Sample App, the UR Encoder SDK and UR Encoder Browser Desktop need to retrieve the necessary files from npm. When retrieving files via an SSL Connection, the Website's Certificate is validated to ensure that the files are being retrieved from a trusted source.

Some Enterprise VPNs and Next-Generation Firewalls perform SSL Inspection and rewrite the certificate that is used. If your organization is seeing the SELF_SIGNED_CERT_IN_CHAIN Error, then this typically means SSL Inspection is rewriting the certificate in this manner.

If this occurs, your organization has two options:

Option 1: Build the Image outside of the Enterprise VPN or Next-Generation Firewall

Option 2: Manually Retrieve the Rewritten Certificate & Update the Docker Configuration


Option 1: Build the Image outside of the Enterprise VPN or Next-Generation Firewall

The first option is to build the FaceTec UR Encoder Sample App Image on a machine outside of the Enterprise VPN or Next-Generation Firewall. Afterwards, it can be transferred via a Removable Storage Device or a Secure Intranet Connection. If Docker is not already installed on the Server with the Enterprise VPN or Next-Generation Firewall, then you will need to install the Docker Engine from its Static Binary.


Option 2: Manually Retrieve the Rewritten Certificate & Update the Docker Configuration

The second option is to manually export the Rewritten Certificate and then update the Docker Configuration to use the Rewritten Certificate.

Step 1: Export Your Certificate
  1. Navigate to https://registry.npmjs.org.
  2. Next to the URL in Your Browser's Search Bar, click on the Site Information button.
  3. Click on "Connection is Secure".
  4. Click "Certificate is Valid".
  5. Go to "Details".
  6. Look for Your Organization's Certificate in the Certificate Fields dropdown.
  7. Click "Export" and ensure you save the certificate as Base-64 Encoded X.509 or Base-64 Encoded ASCII.
  8. If the certificate was saved as Base-64 Encoded X.509, rename the file from <CERTIFICATE_NAME>.cer to <CERTIFICATE_NAME>.crt.
Step 2: Configure the Usage of the Certificate

UR Encoder SDK:

  1. Navigate to the "encoder_browser_sample" directory.
  2. Open the Dockerfile file in a text editor of your choice and update the contents to the provided Dockerfile below.
  3. If Your Certificate is <CERTIFICATE_NAME>.pem, you should update the <CERTIFICATE_NAME>.pem to <CERTIFICATE_NAME>.crt.

UR Encoder Desktop:

  1. Press WIN + R and entering "%appdata%\UR_Encoder\encoder_browser_sample".
  2. Open the Dockerfile file in a text editor of your choice and update the contents to the provided Dockerfile below.
  3. If Your Certificate is <CERTIFICATE_NAME>.pem, you should update the <CERTIFICATE_NAME>.pem to <CERTIFICATE_NAME>.crt.
  4. Navigate one directory upward so that you are in the "UR_Encoder" directory.
  5. Double click "setup.bat" and follow the steps for setting up the UR Encoder Desktop.
# Use Node.js base image
FROM node:latest

# Set working directory
WORKDIR /app

# Copy root-level package.json and install dependencies
COPY package*.json ./

COPY <CERTIFICATE_NAME>.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates
ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/<CERTIFICATE_NAME>.crt

RUN npm install

# Copy everything after installing dependencies
COPY . .

# Switch to the FaceTec-Browser-UR-Code-Encoder-Sample-App directory
WORKDIR /app/FaceTec-Browser-UR-Code-Encoder-Sample-App

RUN npm install

# Switch back to the home directory
WORKDIR /app

# Allow connection to the Docker container on port 8000
EXPOSE 8000

# Start the FaceTec UR Browser App
CMD ["bash", "run.sh"]