Serve verified HTTPS locally
ASPL 0.7.0 · Current release
Native only. Serve verified HTTPS locally, with exact supplied sources, requirements, commands and outcomes.
On this page
Prepare the native host
Listen on 127.0.0.1:8443. Supply server.pem and matching unencrypted server.key in the process working directory. The certificate must have a localhost DNS SAN. Run the HTTPS client separately; POST /stop drains.
Follow the deployment guide for certificates, CA selection, working directories and the complete upstream workflow.
Follow the HTTP guide and API reference. Keep the original filenames and the modules of the selected source variant. Save Arabic and English variants in separate directories. TLS inputs are supplied by the reader, with no bundled certificates or keys. No other data assets are required.
Arabic source
Execution: Native only · ASPL 0.7.0
- Native only. Published ASPL 0.7.0 on x86-64 Linux with glibc 2.34 or later. No input lines. Listen on 127.0.0.1:8443. Supply server.pem and matching unencrypted server.key in the process working directory. The certificate must have a localhost DNS SAN. Run the HTTPS client separately; POST /stop drains.
Input: No input lines are required.
Arabic source · Required source modules, keep each variant in a separate directory:
استورد أساسي::ويب.
استورد إعدادات.لبات بسم تطبيق.
استورد معالجات.لبات بسم معالجات.
دالة ابدأ_الرئيسية() -> ص64 {
دع نتيجة_الحساب = ويب::اخدم(تطبيق::خادم(صواب), معالجات::وجهات(),
تطبيق::إعدادات { خادم_بعيد: "https://localhost:9443/hello", مرجع: "server.pem" },
تطبيق::حالة { عدد: 0 }).
إذا ليس نتيجة_الحساب::نجاح { اطبع(نتيجة_الحساب::الخطأ::الرمز). أرجع 1. }
أرجع 0.
}
Follow the Linux instructions to run this example. Download the source to keep a copy.
Download اتصال-مشفر-مباشر.لباتExpected outcomes
{
"native": {
"check": 0,
"status": 0,
"output": ""
}
}English source
Execution: Native only · ASPL 0.7.0
- Native only. Published ASPL 0.7.0 on x86-64 Linux with glibc 2.34 or later. No input lines. Listen on 127.0.0.1:8443. Supply server.pem and matching unencrypted server.key in the process working directory. The certificate must have a localhost DNS SAN. Run the HTTPS client separately; POST /stop drains.
Input: No input lines are required.
English source · Required source modules, keep each variant in a separate directory:
import core::http;
import settings.aspl as app;
import handlers.aspl as handlers;
fn start_main() -> i64 {
let result = http::serve(app::server(true), handlers::routes(),
app::Config { upstream: "https://localhost:9443/hello", ca: "server.pem" },
app::State { count: 0 });
if not result::ok { print(result::error::code); return 1; }
return 0;
}
Follow the Linux instructions to run this example. Download the source to keep a copy.
Download direct-tls.asplExpected outcomes
{
"native": {
"check": 0,
"status": 0,
"output": ""
}
}Commands and outcomes
ar:
aspl check ar/direct-tls.لبات
aspl run ar/direct-tls.لبات
aspl build -o http-direct-tls-ar-program ar/direct-tls.لبات
./http-direct-tls-ar-programen:
aspl check en/direct-tls.لبات
aspl run en/direct-tls.لبات
aspl build -o http-direct-tls-en-program en/direct-tls.لبات
./http-direct-tls-en-programRun these commands from the parent of the separate ar/en source directories. The TLS service stays in the foreground until a verified POST /stop, then exits with 0 and no output. Start its matching HTTPS client separately. Expected outcome details above come from the catalog. See the HTTP collection.