<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://wiki.nathancampos.me/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://wiki.nathancampos.me/feed.php">
        <title>Nathan&#039;s KB - log</title>
        <description>Hello</description>
        <link>http://wiki.nathancampos.me/</link>
        <image rdf:resource="http://wiki.nathancampos.me/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-13T09:00:26+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://wiki.nathancampos.me/doku.php?id=log:openssl-self-ca"/>
                <rdf:li rdf:resource="http://wiki.nathancampos.me/doku.php?id=log:php-windows"/>
                <rdf:li rdf:resource="http://wiki.nathancampos.me/doku.php?id=log:public-local-server"/>
                <rdf:li rdf:resource="http://wiki.nathancampos.me/doku.php?id=log:uz801-openwrt"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://wiki.nathancampos.me/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Nathan's KB</title>
        <link>http://wiki.nathancampos.me/</link>
        <url>http://wiki.nathancampos.me/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://wiki.nathancampos.me/doku.php?id=log:openssl-self-ca">
        <dc:format>text/html</dc:format>
        <dc:date>2026-05-02T08:19:58+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>openssl-self-ca</title>
        <link>http://wiki.nathancampos.me/doku.php?id=log:openssl-self-ca</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;self-hosted_root_ca_using_openssl&quot;&gt;Self-hosted Root CA using OpenSSL&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Do you hate how modern web browsers complain about using HTTP as if it&amp;#039;s actually insecure to read plain text? It&amp;#039;s extremely dumb to think that self-hosted infrastructure is insecure and must be accessed via HTTPS, especially when it&amp;#039;s only accessible locally or via a VPN, but here we are.
&lt;/p&gt;

&lt;p&gt;
Modern browsers block these “insecure” websites from accessing your camera, microphone, and even the clipboard, and some of these features may be important for some homelab applications. Thus the need for you becoming your own Root CA arrises.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Self-hosted Root CA using OpenSSL&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;self-hosted_root_ca_using_openssl&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-587&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;building_the_certificate_authority&quot;&gt;Building the Certificate Authority&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This is how you can run your own CA infrastructure easily using only the default install of &lt;a href=&quot;https://www.openbsd.org/&quot; class=&quot;urlextern&quot; title=&quot;https://www.openbsd.org/&quot; rel=&quot;ugc nofollow&quot;&gt;OpenBSD 7&lt;/a&gt;. Unless otherwise noted all steps taken here assume the root folder of the CA resides in the &lt;code&gt;/ca&lt;/code&gt; directory at the root of your system drive.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Building the Certificate Authority&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;building_the_certificate_authority&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;588-912&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit3&quot; id=&quot;creating_the_folder_structure&quot;&gt;Creating the Folder Structure&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
A Trusted Root Certificate Authority is a serious business, so you should be serious about the organization of your operation, for this I have created the following folder structure to ensure the CA infrastructure that is built is actually scalable and organized:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;ca        &lt;span class=&quot;co0&quot;&gt;# The root of our CA infrastructure.&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;ca&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;root   &lt;span class=&quot;co0&quot;&gt;# Stores the Root Certificate.&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;ca&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;certs  &lt;span class=&quot;co0&quot;&gt;# Stores the self-signed domain certificates we issue.&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;ca&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;utils  &lt;span class=&quot;co0&quot;&gt;# Contains utility scripts to manage our operation.&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
If you&amp;#039;re following this guide, this folder structure is expected to be in place.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Creating the Folder Structure&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;creating_the_folder_structure&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;913-1565&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit4&quot; id=&quot;getting_a_root_certificate&quot;&gt;Getting a Root Certificate&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
The root certificate will be responsible for creating the chain of trust of all your issued certificates. It&amp;#039;s also &lt;strong&gt;the only one that will have to be installed&lt;/strong&gt; in your clients to allow them to accept your self-signed certificates for all your locally-hosted websites. To create a root certificate you&amp;#039;ll have to do the following:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;ca&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;root
openssl genrsa &lt;span class=&quot;re5&quot;&gt;-des3&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-out&lt;/span&gt; root.key &lt;span class=&quot;nu0&quot;&gt;2048&lt;/span&gt;
openssl req &lt;span class=&quot;re5&quot;&gt;-x509&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-new&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-nodes&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-key&lt;/span&gt; root.key &lt;span class=&quot;re5&quot;&gt;-sha256&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-days&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3650&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-out&lt;/span&gt; root.pem&lt;/pre&gt;

&lt;p&gt;
I won&amp;#039;t pretend to understand exactly the implications of my decisions here in terms of parameters, but this should create a root certificate that will be good for 10 years.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Getting a Root Certificate&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;getting_a_root_certificate&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;1566-2263&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit5&quot; id=&quot;generating_openssl_configuration&quot;&gt;Generating OpenSSL Configuration&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
The next step in achieving your status as a Trusted Certificate Authority is to create the OpenSSL configuration files used when generating new certificate requests. The OpenSSL certificate creation process must always go through a signing request procedure, even if you&amp;#039;re doing so on the same machine.
&lt;/p&gt;

&lt;p&gt;
This configuration file is the base of every certificate we generate and most of its contents are the same for every new request, so I have built this handy Perl script that takes care of the configuration file generation for you:
&lt;/p&gt;
&lt;pre class=&quot;code perl&quot;&gt;&lt;span class=&quot;co1&quot;&gt;#!/usr/bin/env perl&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;# Save this script to /ca/utils/make-config.pl&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;=head1 DESCRIPTION
&amp;nbsp;
Builds the OpenSSL configuration file to request a certificate for a domain.
&amp;nbsp;
=cut&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;use&lt;/span&gt; warnings&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;use&lt;/span&gt; strict&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;use&lt;/span&gt; autodie&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;use&lt;/span&gt; File&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;Basename&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;# Main entry point.&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;sub&lt;/span&gt; main &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://perldoc.perl.org/functions/scalar.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;scalar&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;ARGV&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;a href=&quot;http://perldoc.perl.org/functions/die.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;die&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;The domain name of the certificate must be provided.&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;# Get the domain name.&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$domain&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$ARGV&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;# Remind the user that this tool always generates wild card certs.&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://perldoc.perl.org/functions/substr.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$domain&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;eq&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;*&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;a href=&quot;http://perldoc.perl.org/functions/die.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;die&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;This tool generates wildcard certificates. Remove *.&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;# Make the folder and write the configuration file.&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$cldomain&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$folder&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; make_folder&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$domain&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;a href=&quot;http://perldoc.perl.org/functions/open.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;open&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$fh&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;&amp;gt;&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;$folder/openssl.conf&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;a href=&quot;http://perldoc.perl.org/functions/print.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;print&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;re0&quot;&gt;$fh&lt;/span&gt; build_config&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$domain&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;a href=&quot;http://perldoc.perl.org/functions/close.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;close&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;re0&quot;&gt;$fh&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;a href=&quot;http://perldoc.perl.org/functions/print.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;print&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;$cldomain&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;# Creates the folder for the certificate and config, and returns its path.&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;sub&lt;/span&gt; make_folder &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$domain&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;co5&quot;&gt;@_&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$cld&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$domain&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;# Get the path to the certificate folder and make it.&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$folder&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; dirname&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;dirname&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__FILE__&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;/certs/$cld&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;a href=&quot;http://perldoc.perl.org/functions/mkdir.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;mkdir&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;re0&quot;&gt;$folder&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;a href=&quot;http://perldoc.perl.org/functions/return.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;return&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$cld&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$folder&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;# Builds the configuration for the certificate.&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;sub&lt;/span&gt; build_config &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;re0&quot;&gt;$domain&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;co5&quot;&gt;@_&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;a href=&quot;http://perldoc.perl.org/functions/return.html&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;return&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;co4&quot;&gt;&amp;lt;&amp;lt;&amp;quot;CONFIG&amp;quot;;
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
C = XX
ST = Your State
L = Your Neighbourhood
O = Your Totally Legit Company
OU = CA
CN = *.$domain
[v3_req]
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
subjectAltName = \@alt_names
[alt_names]
DNS.1 = $domain
DNS.2 = *.$domain
&amp;nbsp;
CONFIG&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
main&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;__END__&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;=head1 AUTHOR
&amp;nbsp;
Nathan Campos &amp;lt;nathan@innoveworkshop.com&amp;gt;
&amp;nbsp;
=head1 COPYRIGHT
&amp;nbsp;
Copyright (c) 2024- Nathan Campos.
&amp;nbsp;
=cut&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
You should edit the contents of the configuration template just below the &lt;code&gt;[req_distinguished_name]&lt;/code&gt; line to suit your environment. Be sure to be clever when populating these values in.
&lt;/p&gt;

&lt;p&gt;
This script should be placed in the &lt;code&gt;/ca/utils&lt;/code&gt; directory with the name &lt;code&gt;make-config.pl&lt;/code&gt; so that the certificate issuing script can make use of it.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Generating OpenSSL Configuration&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;generating_openssl_configuration&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;2264-5015&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit6&quot; id=&quot;issuing_certificates&quot;&gt;Issuing Certificates&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Issuing a certificate using OpenSSL is a painful process and extremely easy to get wrong or simply get bored of typing a bunch of commands for something that you just want to get over with. Just like I did with the configuration file, here&amp;#039;s a shell script that should automate the whole process for you:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;#!/usr/local/bin/bash&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Ensure we stop on error.&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Ensure we have the right amount of command-line arguments.&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;re4&quot;&gt;$#&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-ne&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;usage: $0 &amp;lt;domain&amp;gt; &amp;lt;desc&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;exit&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Create certificate directory and configuration file.&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Creating the configuration for the certificate request...&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;CLDOMAIN&lt;/span&gt;=$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;utils&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;make-config.pl &lt;span class=&quot;re4&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;CERTDESC&lt;/span&gt;=&lt;span class=&quot;re4&quot;&gt;$2&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;pushd&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;certs/&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Create the certificate request.&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Building private key and certificate request for $1 as &lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;&amp;quot;&lt;/span&gt;
openssl genrsa &lt;span class=&quot;re5&quot;&gt;-out&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.key&amp;quot;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2048&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#openssl genrsa -des3 -out &amp;quot;$CLDOMAIN.key&amp;quot; 2048&lt;/span&gt;
openssl req &lt;span class=&quot;re5&quot;&gt;-new&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-out&lt;/span&gt; request.csr &lt;span class=&quot;re5&quot;&gt;-key&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.key&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-config&lt;/span&gt; openssl.conf
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Create signed certificate.&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Signing certificate for 5 years...&amp;quot;&lt;/span&gt;
openssl x509 &lt;span class=&quot;re5&quot;&gt;-req&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-in&lt;/span&gt; request.csr &lt;span class=&quot;re5&quot;&gt;-CA&lt;/span&gt; ..&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;..&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;root&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;root.pem &lt;span class=&quot;re5&quot;&gt;-CAkey&lt;/span&gt; ..&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;..&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;root&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;root.key \
    &lt;span class=&quot;re5&quot;&gt;-CAcreateserial&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-out&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.crt&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-days&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1827&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-sha256&lt;/span&gt; \
    &lt;span class=&quot;re5&quot;&gt;-extensions&lt;/span&gt; v3_req &lt;span class=&quot;re5&quot;&gt;-extfile&lt;/span&gt; openssl.conf
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Packaging the certificate.&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Packaging the certificate in PKCS#12 format...&amp;quot;&lt;/span&gt;
openssl pkcs12 &lt;span class=&quot;re5&quot;&gt;-export&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-out&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.p12&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-inkey&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.key&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-in&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.crt&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-certfile&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.crt&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-name&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CERTDESC&lt;/span&gt;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Extracting keys in SSH format.&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Extracting keys in SSH format...&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.key&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; openssl rsa &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; id_rsa
openssl rsa &lt;span class=&quot;re5&quot;&gt;-in&lt;/span&gt; id_rsa &lt;span class=&quot;re5&quot;&gt;-pubout&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;ssh-keygen&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;dev&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;stdin &lt;span class=&quot;re5&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-m&lt;/span&gt; PKCS8 &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; id_rsa.pub
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Check our certificate.&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Checking the generated certificate...&amp;quot;&lt;/span&gt;
openssl verify &lt;span class=&quot;re5&quot;&gt;-CAfile&lt;/span&gt; ..&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;..&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;root&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;root.pem &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.crt&amp;quot;&lt;/span&gt;
openssl x509 &lt;span class=&quot;re5&quot;&gt;-text&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-noout&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-in&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.crt&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-14&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;...&amp;quot;&lt;/span&gt;
openssl x509 &lt;span class=&quot;re5&quot;&gt;-text&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-noout&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-in&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$CLDOMAIN&lt;/span&gt;.crt&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;grep&lt;/span&gt; DNS
&amp;nbsp;
&lt;span class=&quot;kw3&quot;&gt;popd&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
This script should issue certificates that are valid for 5 years and exports the public and private keys to every format that you may need, so the generated certificate can be used for web servers, SSH, and basically anything under the sun.
&lt;/p&gt;

&lt;p&gt;
As can be inferred from the usage line in the script, it takes a domain and a description. The description is a bit of text that&amp;#039;s associated with the certificate and can be viewed by visitors of your website. The &lt;code&gt;domain&lt;/code&gt; argument should not contain a wildcard since the &lt;code&gt;make-config.pl&lt;/code&gt; script should take care of this automatically for you.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Issuing Certificates&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;issuing_certificates&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;5016-7572&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit7&quot; id=&quot;adding_ssl_to_your_servers&quot;&gt;Adding SSL to Your Servers&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
The next logical step is to ensure that your servers can actually serve content with your self-signed certificates.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Adding SSL to Your Servers&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;adding_ssl_to_your_servers&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;7573-7729&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit8&quot; id=&quot;nginx_proxy_manager&quot;&gt;Nginx Proxy Manager&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
I like my home servers to be as easy to configure and maintain as possible, not to be the most secure or follow enterprise-grade best practices, so I use the humble &lt;a href=&quot;https://nginxproxymanager.com/&quot; class=&quot;urlextern&quot; title=&quot;https://nginxproxymanager.com/&quot; rel=&quot;ugc nofollow&quot;&gt;Nginx Proxy Manager&lt;/a&gt; as the &lt;a href=&quot;https://en.wikipedia.org/wiki/Reverse_proxy&quot; class=&quot;urlextern&quot; title=&quot;https://en.wikipedia.org/wiki/Reverse_proxy&quot; rel=&quot;ugc nofollow&quot;&gt;reverse proxy&lt;/a&gt; for all my self-hosted applications.
&lt;/p&gt;

&lt;p&gt;
To add your self-signed certificates to your NPM instance you&amp;#039;ll need to download the &lt;code&gt;domain.crt&lt;/code&gt; and &lt;code&gt;domain.key&lt;/code&gt; files from the CA server.
&lt;/p&gt;

&lt;p&gt;
Inside NPM you&amp;#039;ll navigate to the &lt;strong&gt;SSL Certificates&lt;/strong&gt; tab and click &lt;strong&gt;Add SSL Certificate&lt;/strong&gt; and select &lt;code&gt;Custom&lt;/code&gt;. Now all you have to do is fill in the form with the following:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Name: Whatever you want&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Certificate Key: &lt;code&gt;domain.key&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Certificate: &lt;code&gt;domain.crt&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
The last step is to associate the newly added SSL certificate to the domain it belongs to in the Proxy Hosts page by selecting the proxy host you want to edit and going to the SSL tab.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Nginx Proxy Manager&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;nginx_proxy_manager&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:8,&amp;quot;range&amp;quot;:&amp;quot;7730-8697&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit9&quot; id=&quot;getting_clients_to_trust_you&quot;&gt;Getting Clients to Trust You&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Having your own CA is all well and good, but you need to ensure that your clients trust your self-signed certificates, for this you&amp;#039;ll have to add the &lt;code&gt;root.cer&lt;/code&gt; Root Certificate to the list of trusted sources in your clients, and this process is extremely different from system to system, and even may require you to add the certificate to individual applications such as web browsers.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Getting Clients to Trust You&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;getting_clients_to_trust_you&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:9,&amp;quot;range&amp;quot;:&amp;quot;8698-9129&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit10&quot; id=&quot;chromium_and_chromeos&quot;&gt;Chromium and ChromeOS&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
On &lt;a href=&quot;https://en.wikipedia.org/wiki/Chromium_(web_browser)#Browsers_based_on_Chromium&quot; class=&quot;urlextern&quot; title=&quot;https://en.wikipedia.org/wiki/Chromium_(web_browser)#Browsers_based_on_Chromium&quot; rel=&quot;ugc nofollow&quot;&gt;Chromium-based browsers&lt;/a&gt; and &lt;a href=&quot;https://chromeos.google/&quot; class=&quot;urlextern&quot; title=&quot;https://chromeos.google/&quot; rel=&quot;ugc nofollow&quot;&gt;ChromeOS&lt;/a&gt;, you can add your Root Certificate by navigating to the Certificate Manager located at chrome://certificate-manager/localcerts and in the &lt;strong&gt;Custom&lt;/strong&gt; section, click on the &lt;strong&gt;Installed by you&lt;/strong&gt; card.
&lt;/p&gt;

&lt;p&gt;
In the next window, you should import the &lt;code&gt;root.cer&lt;/code&gt; certificate file to the &lt;strong&gt;Trusted Certificates&lt;/strong&gt; section. You should now be able to access your self-hosted services using the needlessly complex HTTPS.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Chromium and ChromeOS&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;chromium_and_chromeos&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:10,&amp;quot;range&amp;quot;:&amp;quot;9130-9727&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit11&quot; id=&quot;windows&quot;&gt;Windows&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Adding the generated root certificate under Windows involves opening the &lt;code&gt;certlm.msc&lt;/code&gt; MMC Plug-In and right-clicking the &lt;strong&gt;Trusted Root Certification Authorities&lt;/strong&gt; folder. In the context menu, you should select &lt;strong&gt;All Tasks &amp;gt; Import…&lt;/strong&gt; and follow the wizard, eventually browsing to the &lt;code&gt;root.cer&lt;/code&gt; certificate file and importing it. While in the wizard, ensure that the “Local Machine” option is selected as the Store Location, since this will ensure that the Root Certificate Authority is trusted system-wide.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Windows&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;windows&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:11,&amp;quot;range&amp;quot;:&amp;quot;9728-10262&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit12&quot; id=&quot;linux&quot;&gt;Linux&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
First make sure you rename the &lt;code&gt;root.cer&lt;/code&gt; file to &lt;code&gt;root.crt&lt;/code&gt;, since it&amp;#039;s required to have the &lt;code&gt;crt&lt;/code&gt; extension for it to be picked up by the certificate manager. Then run the following commands as &lt;code&gt;root&lt;/code&gt; to move the file to its appropriate place and reload the certificate store:
&lt;/p&gt;
&lt;pre class=&quot;code sh&quot;&gt;mkdir -p /usr/local/share/ca-certificates/homelab
cp root.crt /usr/local/share/ca-certificates/homelab/
update-ca-certificates&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Linux&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;linux&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:12,&amp;quot;range&amp;quot;:&amp;quot;10263-&amp;quot;} --&gt;</description>
    </item>
    <item rdf:about="http://wiki.nathancampos.me/doku.php?id=log:php-windows">
        <dc:format>text/html</dc:format>
        <dc:date>2025-07-28T08:11:54+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>php-windows</title>
        <link>http://wiki.nathancampos.me/doku.php?id=log:php-windows</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;php_56_on_windows_server_2008_and_iis&quot;&gt;PHP 5.6 on Windows Server 2008 and IIS&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
For the &lt;a href=&quot;http://occ.sdf.org/#2025&quot; class=&quot;urlextern&quot; title=&quot;http://occ.sdf.org/#2025&quot; rel=&quot;ugc nofollow&quot;&gt;Old Computer Challenge 2025&lt;/a&gt; I had the amazing idea that I wanted to have an old HP t5740 thin client as a public web server on the internet, running Windows Server 2008 and IIS. The goal was to host my own website on it, which requires at least PHP 5.6.
&lt;/p&gt;

&lt;p&gt;
Since running PHP under IIS was never a straightforward process, &lt;a href=&quot;https://akrabat.com/installing-php-on-windows-server-2008/&quot; class=&quot;urlextern&quot; title=&quot;https://akrabat.com/installing-php-on-windows-server-2008/&quot; rel=&quot;ugc nofollow&quot;&gt;although Microsoft did make it easy&lt;/a&gt; with the Microsoft Web Platform Installer 2.0, now days everything has been taken down and a bunch of information and archives are no longer available, so I decided to log my successful steps here in case anyone ever wants to replicate this in the future.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;PHP 5.6 on Windows Server 2008 and IIS&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;php_56_on_windows_server_2008_and_iis&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-767&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This is an old system, and with older systems you need a great deal of responsibility, specially if you&amp;#039;re going to expose any part of them to the public internet. Before continuing ensure that you have fully updated Server 2008 using &lt;a href=&quot;https://legacyupdate.net&quot; class=&quot;urlextern&quot; title=&quot;https://legacyupdate.net&quot; rel=&quot;ugc nofollow&quot;&gt;Legacy Update&lt;/a&gt;, since out-of-the-box Windows Update won&amp;#039;t work because of older TLS versions and expired certificates.
&lt;/p&gt;

&lt;p&gt;
It&amp;#039;s important to note that in order for PHP to run you do need to install the &lt;a href=&quot;https://www.microsoft.com/en-us/download/details.aspx?id=30679&quot; class=&quot;urlextern&quot; title=&quot;https://www.microsoft.com/en-us/download/details.aspx?id=30679&quot; rel=&quot;ugc nofollow&quot;&gt;Microsoft Visual C++ 2012 Redistributable&lt;/a&gt; files. These are required since PHP was compiled with that version of Visual C++. Since a lot of software requires different versions of the redistributable files, my recommendation is always to install &lt;a href=&quot;https://www.techpowerup.com/download/visual-c-redistributable-runtime-package-all-in-one/&quot; class=&quot;urlextern&quot; title=&quot;https://www.techpowerup.com/download/visual-c-redistributable-runtime-package-all-in-one/&quot; rel=&quot;ugc nofollow&quot;&gt;TechPowerUp&amp;#039;s Visual C++ Redistributable Runtimes All-in-One pack&lt;/a&gt;, this will ensure you have all possible versions installed and save you from many headaches down the line.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Prerequisites&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;prerequisites&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;768-1836&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;setting_up_ftp&quot;&gt;Setting up FTP&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Since nothing in Windows can be straightforward, the first problem started when I needed to enable &lt;abbr title=&quot;File Transfer Protocol&quot;&gt;FTP&lt;/abbr&gt; access so that I could send files to the server quickly for installation. This became a problem because as soon as I tried to do a directory listing after connecting to the &lt;abbr title=&quot;File Transfer Protocol&quot;&gt;FTP&lt;/abbr&gt; server it would hang indefinitely.
&lt;/p&gt;

&lt;p&gt;
The reason for this was that Windows Firewall was blocking communication over the &lt;abbr title=&quot;File Transfer Protocol&quot;&gt;FTP&lt;/abbr&gt; passive ports. I tried using active mode and it worked perfectly fine, but since I wanted passive mode working, since that&amp;#039;s easier to manage over all my machines, I had to resort to &lt;a href=&quot;https://www.velikan.net/iis-passive-ftp/index.html&quot; class=&quot;urlextern&quot; title=&quot;https://www.velikan.net/iis-passive-ftp/index.html&quot; rel=&quot;ugc nofollow&quot;&gt;IIS 6 administration scripts and magic&lt;/a&gt; to get everyone happy. The fix involves limiting the port range of IIS&amp;#039;s &lt;abbr title=&quot;File Transfer Protocol&quot;&gt;FTP&lt;/abbr&gt; server and allowing those specific ports through the firewall. This has the side-effect of limiting how many users you can have connected simultaneously.
&lt;/p&gt;

&lt;p&gt;
The fix involves running the following IIS administration script (ensure you have installed the &lt;code&gt;IIS 6 Scripting Tools&lt;/code&gt; role) and specifying the desired port range:
&lt;/p&gt;
&lt;pre class=&quot;code batch&quot;&gt;C:\Inetpub\AdminiScripts\adsutil.vbs &lt;span class=&quot;kw1&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;co101&quot;&gt;/MSFTPSVC/PassivePortRange&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;5500-5520&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Next step is simply going into the Windows Firewall settings and allowing Inbound Traffic through those ports.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Setting up FTP&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;setting_up_ftp&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1837-3157&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;getting_php_binaries&quot;&gt;Getting PHP Binaries&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Since the last PHP 5 for Windows binaries are absent from the &lt;a href=&quot;https://museum.php.net/php5/&quot; class=&quot;urlextern&quot; title=&quot;https://museum.php.net/php5/&quot; rel=&quot;ugc nofollow&quot;&gt;PHP Museum Archives&lt;/a&gt;, I had to use the Wayback Machine to fetch &lt;a href=&quot;https://web.archive.org/web/20190302030312/https://windows.php.net/download/#php-5.6&quot; class=&quot;urlextern&quot; title=&quot;https://web.archive.org/web/20190302030312/https://windows.php.net/download/#php-5.6&quot; rel=&quot;ugc nofollow&quot;&gt;PHP 5.6.40 for Windows&lt;/a&gt;, the last version of the PHP 5 branch. In my case, since I&amp;#039;m running a 32-bit copy of Server 2008, I downloaded the &lt;a href=&quot;https://web.archive.org/web/20190302030312/https://windows.php.net/downloads/releases/php-5.6.40-nts-Win32-VC11-x86.zip&quot; class=&quot;urlextern&quot; title=&quot;https://web.archive.org/web/20190302030312/https://windows.php.net/downloads/releases/php-5.6.40-nts-Win32-VC11-x86.zip&quot; rel=&quot;ugc nofollow&quot;&gt;VC11 x86 Non Thread Safe (2019-Jan-10 00:38:30)&lt;/a&gt; version.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Getting PHP Binaries&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;getting_php_binaries&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;3158-3759&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit5&quot; id=&quot;installing_php&quot;&gt;Installing PHP&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Next logical step was installing PHP 5.6, which in the case of Windows and IIS, requires &lt;a href=&quot;https://web.archive.org/web/20151031212815/http://php.net/manual/en/install.windows.manual.php&quot; class=&quot;urlextern&quot; title=&quot;https://web.archive.org/web/20151031212815/http://php.net/manual/en/install.windows.manual.php&quot; rel=&quot;ugc nofollow&quot;&gt;a manual installation procedure&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Manually installing simply means that you have to unpack the ZIP archive of the PHP distribution onto a folder, usually &lt;code&gt;C:\php&lt;/code&gt;, set the &lt;code&gt;PATH&lt;/code&gt; system environment variable to point to this directory, and rename one of the included configuration file examples to &lt;code&gt;php.ini&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
A step that&amp;#039;s needed is to set the following configuration variables accordingly:
&lt;/p&gt;
&lt;pre class=&quot;code ini&quot;&gt;fastcgi.impersonate &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt; 1&lt;/span&gt;
fastcgi.logging &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt; 0&lt;/span&gt;
cgi.fix_pathinfo&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;1&lt;/span&gt;
cgi.force_redirect &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt; 0&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
This configuration is apparently &lt;strong&gt;required&lt;/strong&gt; in order for PHP to work under IIS, at least according to the &lt;a href=&quot;https://web.archive.org/web/20160401063938/http://php.net/manual/en/install.windows.iis7.php&quot; class=&quot;urlextern&quot; title=&quot;https://web.archive.org/web/20160401063938/http://php.net/manual/en/install.windows.iis7.php&quot; rel=&quot;ugc nofollow&quot;&gt;documentation&lt;/a&gt;.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Installing PHP&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;installing_php&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;3760-4700&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit6&quot; id=&quot;setting_up_iis&quot;&gt;Setting up IIS&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
The next logical step is to setup IIS 7 so that it can properly handle &lt;code&gt;*.php&lt;/code&gt; files and execute the CGI handler. For the first step, &lt;a href=&quot;https://web.archive.org/web/20160401063938/http://php.net/manual/en/install.windows.iis7.php&quot; class=&quot;urlextern&quot; title=&quot;https://web.archive.org/web/20160401063938/http://php.net/manual/en/install.windows.iis7.php&quot; rel=&quot;ugc nofollow&quot;&gt;following the tutorial&lt;/a&gt;, you should setup the &lt;code&gt;Handler Mappings&lt;/code&gt; for PHP in the following manner:
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://wiki.nathancampos.me/lib/exe/fetch.php?media=log:iis7-php5-handler-config.png&quot; class=&quot;media&quot; title=&quot;log:iis7-php5-handler-config.png&quot;&gt;&lt;img src=&quot;http://wiki.nathancampos.me/lib/exe/fetch.php?w=400&amp;amp;tok=df40e4&amp;amp;media=log:iis7-php5-handler-config.png&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;Handler Mapping configuration for PHP&quot; alt=&quot;Handler Mapping configuration for PHP&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Next, in order for &lt;code&gt;index.php&lt;/code&gt; files to get preference over other index files, you should open the &lt;code&gt;Default Document&lt;/code&gt; view in the IIS server manager and add the &lt;code&gt;index.php&lt;/code&gt; directive there. Move it up or down according to your preference of priority.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Setting up IIS&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;setting_up_iis&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;4701-5407&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit7&quot; id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
The following main tutorials by the PHP foundation were followed in order to have this up and running. These articles had to be fetched using the Wayback Machine since PHP already has taken them down in recent years.
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://web.archive.org/web/20160401063938/http://php.net/manual/en/install.windows.iis7.php&quot; class=&quot;urlextern&quot; title=&quot;https://web.archive.org/web/20160401063938/http://php.net/manual/en/install.windows.iis7.php&quot; rel=&quot;ugc nofollow&quot;&gt;Installation on Windows systems: Microsoft IIS 7.0 and later&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://web.archive.org/web/20151031212815/http://php.net/manual/en/install.windows.manual.php&quot; class=&quot;urlextern&quot; title=&quot;https://web.archive.org/web/20151031212815/http://php.net/manual/en/install.windows.manual.php&quot; rel=&quot;ugc nofollow&quot;&gt;Installation on Windows systems: Manual Installation Steps&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;References&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;references&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;5408-&amp;quot;} --&gt;</description>
    </item>
    <item rdf:about="http://wiki.nathancampos.me/doku.php?id=log:public-local-server">
        <dc:format>text/html</dc:format>
        <dc:date>2025-08-23T09:12:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>public-local-server</title>
        <link>http://wiki.nathancampos.me/doku.php?id=log:public-local-server</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;exposing_a_local_server_to_the_public_internet_safely&quot;&gt;Exposing a Local Server to the Public Internet Safely&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
These are the steps I took in order to securely expose a local server on my network to the wild west of the public internet, allowing me to free myself from cloud providers and properly self-host everything (with a small exception).
&lt;/p&gt;

&lt;p&gt;
In this log/tutorial you will notice that I don&amp;#039;t talk about how to secure the network that a “semi public-facing” device is in. The reason for this is that everyone&amp;#039;s network is different, and in my specific case, all devices that are going to be proxied to the outside world will be on a physically separate network (5G modem in my case), thus I don&amp;#039;t have to worry about having a compromised device on my home&amp;#039;s network.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Exposing a Local Server to the Public Internet Safely&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;exposing_a_local_server_to_the_public_internet_safely&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-728&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;bridge_vpn&quot;&gt;Bridge VPN&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
In order to ensure that I don&amp;#039;t have any open ports on my home router and no public internet traffic flowing through my home network, I&amp;#039;ve decided to use a VPN and a cloud VPS (the only exception to the self-hosting everything rule) to provide a secure tunnel for traffic to flow through. This was done using the amazing &lt;a href=&quot;https://www.softether.org&quot; class=&quot;urlextern&quot; title=&quot;https://www.softether.org&quot; rel=&quot;ugc nofollow&quot;&gt;SoftEther VPN project&lt;/a&gt;, which apart from &lt;a href=&quot;https://www.wireguard.com&quot; class=&quot;urlextern&quot; title=&quot;https://www.wireguard.com&quot; rel=&quot;ugc nofollow&quot;&gt;Wireguard&lt;/a&gt; and &lt;a href=&quot;https://tailscale.com&quot; class=&quot;urlextern&quot; title=&quot;https://tailscale.com&quot; rel=&quot;ugc nofollow&quot;&gt;Tailscale&lt;/a&gt;, is in my opinion the best VPN software in the market.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Bridge VPN&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;bridge_vpn&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;729-1279&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit3&quot; id=&quot;setting_up_the_server&quot;&gt;Setting up the Server&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
To set the VPN software up on a &lt;a href=&quot;https://www.hetzner.com&quot; class=&quot;urlextern&quot; title=&quot;https://www.hetzner.com&quot; rel=&quot;ugc nofollow&quot;&gt;Hetzner VPS&lt;/a&gt; in &lt;a href=&quot;https://www.softether.org/4-docs/1-manual/3._SoftEther_VPN_Server_Manual/3.6_Local_Bridges&quot; class=&quot;urlextern&quot; title=&quot;https://www.softether.org/4-docs/1-manual/3._SoftEther_VPN_Server_Manual/3.6_Local_Bridges&quot; rel=&quot;ugc nofollow&quot;&gt;Local Bridge&lt;/a&gt; mode in order to avoid the bottleneck of &lt;a href=&quot;https://www.softether.org/index.php?title=4-docs/1-manual/3._SoftEther_VPN_Server_Manual/3.7_Virtual_NAT_%26_Virtual_DHCP_Servers&quot; class=&quot;urlextern&quot; title=&quot;https://www.softether.org/index.php?title=4-docs/1-manual/3._SoftEther_VPN_Server_Manual/3.7_Virtual_NAT_%26_Virtual_DHCP_Servers&quot; rel=&quot;ugc nofollow&quot;&gt;SecureNAT&lt;/a&gt;, I&amp;#039;ve followed the &lt;a href=&quot;https://tweenpath.net/softether-vps-local-bridge/&quot; class=&quot;urlextern&quot; title=&quot;https://tweenpath.net/softether-vps-local-bridge/&quot; rel=&quot;ugc nofollow&quot;&gt;following tutorial&lt;/a&gt;. Since Hetzner VPSes by default use DHCP for IPv4 address attribution, this will conflict with the DHCP server we need to install in order to run the local bridge, so following &lt;a href=&quot;https://docs.hetzner.com/cloud/servers/static-configuration/&quot; class=&quot;urlextern&quot; title=&quot;https://docs.hetzner.com/cloud/servers/static-configuration/&quot; rel=&quot;ugc nofollow&quot;&gt;this Hetzner tutorial for static IP configuration&lt;/a&gt; is required in order for the setup to work.
&lt;/p&gt;

&lt;p&gt;
Since I wasn&amp;#039;t able to get the DHCP server using &lt;code&gt;dnsmasq&lt;/code&gt; to work no matter what I tried, I had to enable SecureNAT on the server, but disabling the Virtual NAT which is the extremely slow layer that greatly impacts performance, thus only using the DHCP server. The configuration used was the following:
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://wiki.nathancampos.me/lib/exe/detail.php?id=log%3Apublic-local-server&amp;amp;media=log:softether-securenat-prefs.png&quot; class=&quot;media&quot; title=&quot;log:softether-securenat-prefs.png&quot;&gt;&lt;img src=&quot;http://wiki.nathancampos.me/lib/exe/fetch.php?w=400&amp;amp;tok=577a75&amp;amp;media=log:softether-securenat-prefs.png&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;SecureNAT Configuration&quot; alt=&quot;SecureNAT Configuration&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Since we are using a DHCP server to hand out IPs in our VPN we need to ensure that the server also has an IP assigned to the TAP interface that it&amp;#039;s using to communicate within the VPN&amp;#039;s network. This can be tested by running &lt;code&gt;dhclient tap_vpn&lt;/code&gt;, where &lt;code&gt;tap_vpn&lt;/code&gt; is the VPN&amp;#039;s TAP interface name, and later making this change permanent by adding the following to your &lt;code&gt;/etc/network/interfaces&lt;/code&gt; file (assuming Debian):
&lt;/p&gt;
&lt;pre class=&quot;code conf&quot;&gt;auto tap_vpn
allow-hotplug tap_vpn
iface tap_vpn inet dhcp&lt;/pre&gt;

&lt;p&gt;
The last step in the server side of things is to ensure that &lt;code&gt;systemd&lt;/code&gt; can properly start the server upon a system start. Since all tutorials on the internet are still using &lt;code&gt;initd&lt;/code&gt;, here I have the &lt;code&gt;systemd&lt;/code&gt; unit file that I used, which was taken from the &lt;a href=&quot;https://packages.debian.org/bookworm/softether-vpnserver&quot; class=&quot;urlextern&quot; title=&quot;https://packages.debian.org/bookworm/softether-vpnserver&quot; rel=&quot;ugc nofollow&quot;&gt;softether-vpnserver&lt;/a&gt; Debian package and slightly modified:
&lt;/p&gt;
&lt;pre class=&quot;code ini&quot;&gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Unit&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;SoftEther VPN Server&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;After&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;network.target auditd.service&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Service&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;forking&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;TasksMax&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;16777216&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;/root/vpnserver/vpnserver start&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;/root/vpnserver/vpnserver stop&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;KillMode&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;process&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;Restart&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;on-failure&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;CapabilityBoundingSet&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYSLOG CAP_SETUID&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Install&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;re1&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;multi-user.target&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
After all of these changes a reboot should be done on the server just to ensure that everything comes up automatically and works.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Setting up the Server&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;setting_up_the_server&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1280-3918&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit4&quot; id=&quot;securing_the_vpn_network&quot;&gt;Securing the VPN Network&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Since there will be different types of users on this VPN, it&amp;#039;s important to create some groups, at least one for your public-facing servers and another one for all your local servers. This will make ACLs much easier to create and manage. Also ensure that your servers are all authenticating with extremely strong passwords or client certificates.
&lt;/p&gt;

&lt;p&gt;
It&amp;#039;s also important to ensure that, if a system on your VPN&amp;#039;s network becomes compromised, that an attacker isn&amp;#039;t able to use it to jump to other nodes on your VPN, specially the internet facing server. For this, a simple but effective measure would be to setup some &lt;a href=&quot;https://www.softether.org/4-docs/1-manual/3._SoftEther_VPN_Server_Manual/3.5_Virtual_Hub_Security_Features#3.5.10_Packet_Filtering_with_the_Access_List&quot; class=&quot;urlextern&quot; title=&quot;https://www.softether.org/4-docs/1-manual/3._SoftEther_VPN_Server_Manual/3.5_Virtual_Hub_Security_Features#3.5.10_Packet_Filtering_with_the_Access_List&quot; rel=&quot;ugc nofollow&quot;&gt;Access List&lt;/a&gt; rules blocking traffic that could be used to compromise other systems.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Securing the VPN Network&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;securing_the_vpn_network&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;3919-4809&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit5&quot; id=&quot;reverse_proxy&quot;&gt;Reverse Proxy&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Since we are not exposing our local network directly to the open internet by means of port forwarding, we will require a reverse proxy server that is exposed to the internet. In this case I have a Hetzner VPS running &lt;a href=&quot;https://www.debian.org&quot; class=&quot;urlextern&quot; title=&quot;https://www.debian.org&quot; rel=&quot;ugc nofollow&quot;&gt;Debian&lt;/a&gt; and &lt;a href=&quot;https://nginx.org/en/&quot; class=&quot;urlextern&quot; title=&quot;https://nginx.org/en/&quot; rel=&quot;ugc nofollow&quot;&gt;nginx&lt;/a&gt;, this is the simplest and most flexible setup for a reverse proxy. Even though I have many years of experience with &lt;a href=&quot;https://httpd.apache.org&quot; class=&quot;urlextern&quot; title=&quot;https://httpd.apache.org&quot; rel=&quot;ugc nofollow&quot;&gt;Apache&lt;/a&gt; and have been a bit reluctant to move to nginx, this is the perfect use for it, after all &lt;a href=&quot;https://blog.nginx.org/blog/celebrating-20-years-of-nginx&quot; class=&quot;urlextern&quot; title=&quot;https://blog.nginx.org/blog/celebrating-20-years-of-nginx&quot; rel=&quot;ugc nofollow&quot;&gt;it was initially developed as a reverse proxy&lt;/a&gt;. It&amp;#039;s super performant as a reverse proxy, easy to configure, integrates well with &lt;a href=&quot;https://certbot.eff.org&quot; class=&quot;urlextern&quot; title=&quot;https://certbot.eff.org&quot; rel=&quot;ugc nofollow&quot;&gt;certbot&lt;/a&gt;, and can &lt;a href=&quot;https://nginx.org/en/docs/stream/ngx_stream_proxy_module.html&quot; class=&quot;urlextern&quot; title=&quot;https://nginx.org/en/docs/stream/ngx_stream_proxy_module.html&quot; rel=&quot;ugc nofollow&quot;&gt;proxy raw TCP/UDP streams&lt;/a&gt;.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Reverse Proxy&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;reverse_proxy&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;4810-5695&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit6&quot; id=&quot;setup_for_http_s&quot;&gt;Setup for HTTP(S)&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Setting up nginx for HTTP(S) traffic is super simple, all we need is nginx itself and certbot installed, after these are installed it&amp;#039;s a simple matter of configuring virtual hosts for each site we wish to serve. For each site you want to configure you need to create a new file under &lt;code&gt;/etc/nginx/sites-available/&lt;/code&gt; with the following content:
&lt;/p&gt;
&lt;pre class=&quot;code conf&quot;&gt;server {
    listen 80;
    listen [::]:80;
&amp;nbsp;
    server_name domain.tld www.domain.tld;
&amp;nbsp;
    location / {
        proxy_pass http://ip_vpn_local:80;
        include proxy_params;
    }
}&lt;/pre&gt;

&lt;p&gt;
To enable this virtual host we need to symlink it to the &lt;code&gt;/etc/nginx/sites-enabled/&lt;/code&gt; and restart the web server:
&lt;/p&gt;
&lt;pre class=&quot;code sh&quot;&gt;ln -sf /etc/nginx/sites-available/yourdomain /etc/nginx/sites-enabled/
systemctl restart nginx&lt;/pre&gt;

&lt;p&gt;
This is all it takes to reverse proxy an HTTP website. Now for enabling HTTPS so that modern, pedantic and useless, browsers can access our website without complaining:
&lt;/p&gt;
&lt;pre class=&quot;code sh&quot;&gt;apt install certbot python3-certbot-nginx
certbot --nginx --no-redirect
systemctl reload nginx&lt;/pre&gt;

&lt;p&gt;
Follow the wizard for certbot and you should now have a website that has HTTPS active and won&amp;#039;t automatically redirect to it, so that older browsers are still able to access your website without requiring useless encryption.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Setup for HTTP(S)&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;setup_for_http_s&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;5696-7018&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit7&quot; id=&quot;setup_for_tcp&quot;&gt;Setup for TCP&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Setting up nginx for proxying TCP streams is even easier than for HTTP. This is useful for things like &lt;a href=&quot;https://en.wikipedia.org/wiki/Gopher_(protocol)&quot; class=&quot;urlextern&quot; title=&quot;https://en.wikipedia.org/wiki/Gopher_(protocol)&quot; rel=&quot;ugc nofollow&quot;&gt;Gopher&lt;/a&gt;. To set this up you need to install the stream module for nginx:
&lt;/p&gt;
&lt;pre class=&quot;code sh&quot;&gt;apt install libnginx-mod-stream&lt;/pre&gt;

&lt;p&gt;
Next you should edit your &lt;code&gt;/etc/nginx/nginx.conf&lt;/code&gt; and append the following at the end of the file:
&lt;/p&gt;
&lt;pre class=&quot;code conf&quot;&gt;stream {
    server {
        listen 70;
        listen [::]:70;
&amp;nbsp;
        proxy_pass ip_vpn_local:70;
    }
}&lt;/pre&gt;

&lt;p&gt;
It&amp;#039;s important to note that this needs to go in your &lt;code&gt;/etc/nginx/nginx.conf&lt;/code&gt; below the &lt;code&gt;http {} &lt;/code&gt; directive and that, as usual, a restart of the web server is required.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Setup for TCP&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;setup_for_tcp&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:5,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;7019-&amp;quot;} --&gt;</description>
    </item>
    <item rdf:about="http://wiki.nathancampos.me/doku.php?id=log:uz801-openwrt">
        <dc:format>text/html</dc:format>
        <dc:date>2025-08-20T15:06:49+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>uz801-openwrt</title>
        <link>http://wiki.nathancampos.me/doku.php?id=log:uz801-openwrt</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;running_openwrt_on_a_uz801_usb_4g_modem&quot;&gt;Running OpenWRT on a UZ801 USB 4G Modem&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
This is a log of everything I did to get &lt;a href=&quot;https://openwrt.org/&quot; class=&quot;urlextern&quot; title=&quot;https://openwrt.org/&quot; rel=&quot;ugc nofollow&quot;&gt;OpenWRT&lt;/a&gt; running on a generic UZ801 USB 4G modem with the Qualcomm MSM8916 SoC.
&lt;/p&gt;

&lt;p&gt;
All of this was done on macOS Monterey, so keep that in mind when following this log, and ensure that you use commands that are appropriate to your platform.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Running OpenWRT on a UZ801 USB 4G Modem&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;running_openwrt_on_a_uz801_usb_4g_modem&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-360&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
These are the most basic things that you&amp;#039;ll need to get started on this endeavour:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://developer.android.com/tools/releases/platform-tools&quot; class=&quot;urlextern&quot; title=&quot;https://developer.android.com/tools/releases/platform-tools&quot; rel=&quot;ugc nofollow&quot;&gt;Android platform-tools&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; libusb (&lt;a href=&quot;https://formulae.brew.sh/formula/libusb&quot; class=&quot;urlextern&quot; title=&quot;https://formulae.brew.sh/formula/libusb&quot; rel=&quot;ugc nofollow&quot;&gt;Homebrew&lt;/a&gt; or &lt;a href=&quot;https://ports.macports.org/port/libusb/details/&quot; class=&quot;urlextern&quot; title=&quot;https://ports.macports.org/port/libusb/details/&quot; rel=&quot;ugc nofollow&quot;&gt;MacPorts&lt;/a&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://github.com/bkerler/edl&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/bkerler/edl&quot; rel=&quot;ugc nofollow&quot;&gt;edl&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
These can be easily installed, but &lt;a href=&quot;https://github.com/bkerler/edl&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/bkerler/edl&quot; rel=&quot;ugc nofollow&quot;&gt;edl&lt;/a&gt; will require the following to be installed on your system:
&lt;/p&gt;
&lt;pre class=&quot;code sh&quot;&gt;git clone https://github.com/bkerler/edl.git
cd edl
git submodule update --init --recursive
python3 setup.py build
sudo python3 setup.py install&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Prerequisites&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;prerequisites&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;361-1034&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;getting_adb_access&quot;&gt;Getting ADB Access&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
By default you won&amp;#039;t have &lt;code&gt;adb&lt;/code&gt; access to your 4G dongle, this isn&amp;#039;t described in many places on the internet, and took me a while to figure out, but &lt;a href=&quot;https://extrowerk.com/2022-07-31/OpenStick.html&quot; class=&quot;urlextern&quot; title=&quot;https://extrowerk.com/2022-07-31/OpenStick.html&quot; rel=&quot;ugc nofollow&quot;&gt;this tutorial&lt;/a&gt; showed that, in order to enable &lt;code&gt;adb&lt;/code&gt; on newer versions of the firmware, you need to access the following &lt;abbr title=&quot;Uniform Resource Locator&quot;&gt;URL&lt;/abbr&gt; in the web administration console: &lt;a href=&quot;http://192.168.100.1/usbdebug.html&quot; class=&quot;urlextern&quot; title=&quot;http://192.168.100.1/usbdebug.html&quot; rel=&quot;ugc nofollow&quot;&gt;http://192.168.100.1/usbdebug.html&lt;/a&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Getting ADB Access&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;getting_adb_access&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1035-1471&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;backup_firmware&quot;&gt;Backup Firmware&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
To ensure that any further modifications we do in the future are safe and can be reverted in case of crashes perform the following commands to backup the stock firmware of your device:
&lt;/p&gt;
&lt;pre class=&quot;code sh&quot;&gt;adb reboot edl
python3 edl.py rf uz801_backup.bin&lt;/pre&gt;

&lt;p&gt;
This will take a couple of minutes to finish, but you should now have a full dump of the device&amp;#039;s firmware which can be restored with the following command:
&lt;/p&gt;
&lt;pre class=&quot;code sh&quot;&gt;python3 edl.py wf uz801_backup.bin&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Backup Firmware&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;backup_firmware&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;1472-1967&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit5&quot; id=&quot;openwrt_flashing&quot;&gt;OpenWRT Flashing&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
OpenWRT on this platform is supported by a &lt;a href=&quot;https://github.com/AlienWolfX/UZ801-USB_MODEM&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/AlienWolfX/UZ801-USB_MODEM&quot; rel=&quot;ugc nofollow&quot;&gt;fork from AlienWolfX&lt;/a&gt;, this is the base that was used. To get the latest version of the compiled firmware files you go to the repository&amp;#039;s &lt;a href=&quot;https://github.com/AlienWolfX/UZ801-USB_MODEM/releases&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/AlienWolfX/UZ801-USB_MODEM/releases&quot; rel=&quot;ugc nofollow&quot;&gt;Releases page&lt;/a&gt; and look for the latest OpenWRT release there, then it&amp;#039;s a matter of running the included &lt;code&gt;flash.sh&lt;/code&gt; script, which I have reproduced here for transparency reasons:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;=============================&#039;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;       OpenWRT Installer     &#039;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;https://github.com/AlienWolfX&#039;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;=============================&#039;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;Rebooting to bootloader..&#039;&lt;/span&gt;
adb reboot bootloader
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;Done.&#039;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
&amp;nbsp;
fastboot erase boot
fastboot flash aboot aboot.bin
fastboot reboot
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;Done.&#039;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
&amp;nbsp;
fastboot oem dump fsc &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; fastboot get_staged fsc.bin
fastboot oem dump fsg &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; fastboot get_staged fsg.bin
fastboot oem dump modemst1 &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; fastboot get_staged modemst1.bin
fastboot oem dump modemst2 &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; fastboot get_staged modemst2.bin
fastboot erase boot
fastboot reboot bootloader
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;Done.&#039;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
&amp;nbsp;
fastboot flash partition gpt_both0.bin
fastboot flash hyp hyp.mbn
fastboot flash rpm rpm.mbn
fastboot flash sbl1 sbl1.mbn
fastboot flash tz tz.mbn
fastboot flash fsc fsc.bin
fastboot flash fsg fsg.bin
fastboot flash modemst1 modemst1.bin
fastboot flash modemst2 modemst2.bin
fastboot flash aboot aboot.bin
fastboot flash cdt sbc_1.0_8016.bin
fastboot erase boot
fastboot erase rootfs
fastboot flash boot boot.img
fastboot flash rootfs rootfs.img
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;Done.&#039;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;Rebooting to system..&#039;&lt;/span&gt;
fastboot reboot
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;All Done! you can access your device now.&#039;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
You should now have OpenWRT fully working and accessible at &lt;a href=&quot;http://192.168.1.1&quot; class=&quot;urlextern&quot; title=&quot;http://192.168.1.1&quot; rel=&quot;ugc nofollow&quot;&gt;http://192.168.1.1&lt;/a&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;OpenWRT Flashing&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;openwrt_flashing&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;1968-3758&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit6&quot; id=&quot;fix_usb_tethering_rndis&quot;&gt;Fix USB Tethering (RNDIS)&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
After flashing OpenWRT I had issues with Windows 7 (yes, that&amp;#039;s the only computer I had on hand with Windows to test quickly) not recognizing the RNDIS driver for USB tethering. I was able to get it working after finding &lt;a href=&quot;https://github.com/AlienWolfX/UZ801-USB_MODEM/issues/10&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/AlienWolfX/UZ801-USB_MODEM/issues/10&quot; rel=&quot;ugc nofollow&quot;&gt;this issue&lt;/a&gt; which linked to &lt;a href=&quot;https://xdaforums.com/t/issue-with-native-usb-tethering-in-windows-7.834487/#post-12758233&quot; class=&quot;urlextern&quot; title=&quot;https://xdaforums.com/t/issue-with-native-usb-tethering-in-windows-7.834487/#post-12758233&quot; rel=&quot;ugc nofollow&quot;&gt;this XDA Developers post&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Since I no longer trust the new XDA Developers website owners to keep the site up in the future, here are the steps to fix this:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Go to &lt;code&gt;Device Manager&lt;/code&gt; and find the &lt;code&gt;RNDIS&lt;/code&gt; device that&amp;#039;s currently unknown&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Right-click and select “Update Drivers”&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Choose to browse for the driver and select the “Let me pick from a list of device drivers” option&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Select “Network Adapters”&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Select “Microsoft Corporation” &lt;strong&gt;not&lt;/strong&gt; Microsoft&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Finally select “Remote NDIS based Internet Sharing Device”&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
You should now have everything setup and working.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Fix USB Tethering (RNDIS)&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;fix_usb_tethering_rndis&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;3759-4785&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit7&quot; id=&quot;see_also&quot;&gt;See Also&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Some interesting links that points to resources that were used to figure out what do to with this device:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://github.com/AlienWolfX/UZ801-USB_MODEM&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/AlienWolfX/UZ801-USB_MODEM&quot; rel=&quot;ugc nofollow&quot;&gt;UZ801 v3.2 USB Modem Analysis&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://wvthoog.nl/openstick/&quot; class=&quot;urlextern&quot; title=&quot;https://wvthoog.nl/openstick/&quot; rel=&quot;ugc nofollow&quot;&gt;OpenStick - wvthoog.nl&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://github.com/u0d7i/uz801&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/u0d7i/uz801&quot; rel=&quot;ugc nofollow&quot;&gt;u0d7i/uz801&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://extrowerk.com/2022-07-31/OpenStick.html&quot; class=&quot;urlextern&quot; title=&quot;https://extrowerk.com/2022-07-31/OpenStick.html&quot; rel=&quot;ugc nofollow&quot;&gt;OpenStick - extrowerk&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://github.com/OpenStick/OpenStick/issues/46&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/OpenStick/OpenStick/issues/46&quot; rel=&quot;ugc nofollow&quot;&gt;OpenStick UZ801 V3.0 Support&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;See Also&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;see_also&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;4786-&amp;quot;} --&gt;</description>
    </item>
</rdf:RDF>
