RUN WITH CERTIFICATE AUTHORITY (LetsEncrypt) SIGNED SSL ON REMOTE PC
Before running any new configuration always clear browsing data on the client device.
Self-signed SSLs are fine for testing but are not adequate in a production environment - browser in use will throw up ugly "not safe" warnings.
The following assumes you are installing on a remote PC which is an
AWS EC2 Windows instance (server edition) but you should fairly readily be able to translate it to other remote environments.
It is also assumed you have registered a domain (yourdomain.com) via the AWS Route 53 service that points to the AWS EC2 Windows instance.
The following is based in part on:
https://www.b4x.com/android/forum/threads/server-letsencrypt-ssl-certificates.159285/#content
which describes how to generate and maintain Certificate Authority signed SSLs via LetsEncrypt.
Step 1
Install CertBot - if you use the above URL you might get quite confused and you should also be aware of:
https://www.b4x.com/android/forum/threads/certbot-discontinuing-windows-beta-support-in-2024.160254/
At time of writing you need to get to:
https://certbot.eff.org/instructions?ws=other&os=windows
then scroll down to a URL:
https://github.com/certbot/certbot/...d/certbot-beta-installer-win_amd64_signed.exe
which will download [certbot-beta-installer-win_amd64_signed.exe]
Locate this file, launch it and follow breadcrumbs to install [C:\Program Files\Certbot\bin\certbot.exe]
Step 2
Install Git which includes OpenSSL:
https://gitforwindows.org/
This is straightforward, you download [Git-2.44.0-64-bit.exe]
Locate this file, launch it and follow breadcrumbs to install [C:\Program Files\Git\usr\bin\openssl.exe]
Step 3
When it is creating an SSL certificate, LetsEncrypt conducts a "challenge" dialog with PC on http (port 80) to confirm ownership of the domain.
To accommodate this there must be a server running on the PC that is listening on this port.
Ensure your AWS EC2 Windows instance has a security group rule http for port 80.
As you are using a server edition of Windows you can use IIS.
Step 4
Install IIS.
See:
Skip [Section 1 Configuring And Launching EC2 Instance]
Use [Section 2 Installation of web Server IIS on EC2 Instance]
Skip [Section 3 Creating webpage And hosting it on EC2 Instance]
Skip [Section 4 Deleting Instance]
Step 5
In the PC's Windows taskbar search box, search For "IIS" then click [Internet Information Services (IIS) Manager]
In left hand panel right click only entry (something like [EC2AMAZ-UJ82A3M...]) > [Add Website]
Site name: [
.well-known]
<<<<<<< without [ ], note the leading full stop (.) in [.well-known]
Physical path: navigate to [D:\ABMMini\Cam_4_ABM\Objects\www]
[Connect as...] > [Application user (pass-through authentication)] > [OK]
[OK]
Step 6
Following file should already exist, but if it doesn't...
Set up a test by using Notepad to create a file [D:\ABMMini\Cam_4_ABM\Objects\www\.well-known\acme-challenge\dummy.txt] containing some junk (e.g. "dummy junk")
Step 7
On another PC, test IIS works by launching a browser and using a URL of:
which should display "dummy junk"
Step 8
Certbot must be run with administrative privileges, the easiest way to do this when running the B4J project in Debug mode is to give the B4J.exe administrative privileges:
1. Locate B4J.exe (for example: C:\Program Files\Anywhere Software\B4J\B4J.exe)
2. Right click it > [Properties] > [Compatibility] > [Run this program as an administrator] > [Apply] >[OK]
3. Do not forget to unwind this when finished.
Step 9
1. Launch the B4J project [D:\ABMMini\Cam_4_ABM\Cam_4_ABM.b4j]
2. In the Main module change "yourpassword" to the password you wish to use.
3. In the Main module change "yourdomain.com" to the name of the domain you have set up via the AWS Route 53 service that points to the AWS EC2 Windows instance.
4. In the AppStart procedure of the Main module make sure there is a statement that reads:
CASignedKeystore = True
5. Run the B4J project in Debug mode - the first time you run it it should generate the file keystore.jks in [D:\ABMMini\Cam_4_ABM\Cam_4_ABM\Objects] folder and then hang.
6. Again, run the B4J project in Debug mode - you should now have a running ABMaterial server with a camera component.
7. On a device (with a camera), launch a browser and enter the URL [
https://yourdomain.com:51043/Cam_4_ABM], where yourdomain.com is as per
3.
8. Tap anywhere on the screen to take a photo then go look in [D:\Cam_4_ABM_Photos\PNG] on the AWS EC2 Windows instance to see the photo just taken.