lmssl guide

Overview

lmssl unifies the upstream OpenSSL 4.0.3 command-line utility, statically linked libcrypto and libssl libraries, an embedded default openssl.cnf, and the lmcode-cpp bytecode virtual machine in a single zero-dependency executable. It lets developers and agents run standard openssl commands or execute type-checked _lmcode_ scripts that make every DNS, TCP, TLS, PKI, and cryptographic step explicit.

Dual-mode architecture and embedded OpenSSL 4.0.3

A common frustration with standalone OpenSSL deployments is missing shared libraries or missing openssl.cnf configuration files on minimal containers and build runners. lmssl eliminates both dependencies:

Cryptographic primitives and X.509 PKI builders

The ssl context exposes deterministic wrappers around OpenSSL's EVP and X509 APIs:

Explicit DNS, TCP, and TLS handshake inspection

Unlike high-level HTTP clients that hide connection setup, lmssl separates name resolution, TCP socket connection, TLS policy configuration, and stream I/O so scripts can inspect or test each layer independently:

Standard lmcode_std_v3 REST and CLI interfaces

lmssl embeds the full 226-signature lmcode_std_v3 standard library (cpp/stdlib/rest.hpp). Scripts can expose PKI, digest, or TLS inspection endpoints as HTTP routes or stateless CLI commands:

p = _lmcode_ cli="lmssl" install="github:lmctl-ai/lmssl@latest";
@"--curve"
fn opt_curve(x: RestExchange) -> void implements CliOption {
  x.set("curve", x.query("curve"));
}

@"gen-ca"
fn cmd_gen_ca(x: RestExchange) -> void implements CliCommand {
  let k = ssl.gen_ec(x.get("curve"));
  let c = ssl.new_cert(k, "CN=" + x.body()).ca(true).valid_days(365).sign_self(k, "SHA256");
  x.send(c.subject() + ":" + k.curve());
}

@"/hash/:alg"
fn post_hash(x: RestExchange) -> void implements RestPost {
  x.json("{\"alg\":\"" + x.param("alg") + "\",\"hex\":\"" + ssl.digest(x.param("alg"), x.body()) + "\"}");
}

rest_config("session", "global");
assert_eq(rest_cli(str_split("--curve=P-256 gen-ca -- RootCA", " ")), "CN=RootCA:P-256");
end _lmcode_