{"id":51509506,"url":"https://github.com/murphsicles/ztls","last_synced_at":"2026-07-08T04:30:57.080Z","repository":{"id":361082613,"uuid":"1253027616","full_name":"murphsicles/ztls","owner":"murphsicles","description":"Pure Zeta TLS that provides encrypted communication channels ","archived":false,"fork":false,"pushed_at":"2026-05-29T05:34:25.000Z","size":231,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T07:08:43.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/murphsicles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-29T05:03:10.000Z","updated_at":"2026-05-29T06:45:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/murphsicles/ztls","commit_stats":null,"previous_names":["murphsicles/ztls"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/murphsicles/ztls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Fztls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Fztls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Fztls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Fztls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/murphsicles","download_url":"https://codeload.github.com/murphsicles/ztls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Fztls/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35252324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-08T04:30:56.390Z","updated_at":"2026-07-08T04:30:57.075Z","avatar_url":"https://github.com/murphsicles.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ztls\n\n[![Zeta](https://img.shields.io/badge/Zeta-Language-%23FF6B6B?style=flat-square)](https://zeta-lang.org)\n[![zorbs.io](https://img.shields.io/badge/zorbs.io-@crypto/ztls-%2300C4FF?style=flat-square)](https://zorbs.io/@crypto/ztls)\n[![GitHub](https://img.shields.io/badge/GitHub-murphsicles/ztls-%23181717?style=flat-square)](https://github.com/murphsicles/ztls)\n\nPure Zeta TLS 1.2 and 1.3 implementation. ZTLS provides encrypted communication channels — enabling HTTPS servers, secure client connections, and authenticated peer-to-peer networking without any external C library dependencies.\n\n## Quick Start\n\nAdd to your `zorb.toml`:\n\n```toml\n[dependencies]\n@crypto/ztls = \"1.0\"\n```\n\n### TLS Client (connect to an HTTPS server)\n\n```zeta\nuse @crypto/ztls::{ClientConfig, ServerName, ClientConnection, Stream};\nuse @crypto/ztls::crypto::ring::default_provider;\nuse std::sync::Arc;\nuse std::net::TcpStream;\n\nfn main() {\n    // Set up TLS client config with default crypto provider\n    let config = ClientConfig::builder_with_provider(default_provider().into())\n        .with_safe_defaults()\n        .with_root_certificates(root_store)\n        .with_no_client_auth();\n\n    // Connect TCP\n    let tcp = TcpStream::connect(\"example.com:443\").unwrap();\n    let server_name = ServerName::try_from(\"example.com\").unwrap();\n\n    // Wrap in TLS\n    let mut client = ClientConnection::new(Arc::new(config), server_name).unwrap();\n    let mut tls = Stream::new(\u0026mut client, tcp);\n    tls.write_all(b\"GET / HTTP/1.1\\r\\nHost: example.com\\r\\nConnection: close\\r\\n\\r\\n\").unwrap();\n\n    let mut response = String::new();\n    tls.read_to_string(\u0026mut response).unwrap();\n    print(\"Response: {}\\n\", response);\n}\n```\n\n### TLS Server (serve HTTPS)\n\n```zeta\nuse @crypto/ztls::{ServerConfig, ServerConnection, Stream};\nuse @crypto/ztls::crypto::ring::default_provider;\nuse std::sync::Arc;\nuse std::net::TcpListener;\n\nfn main() {\n    // Load certificate chain and private key\n    let cert_chain = load_certificates(\"cert.pem\").unwrap();\n    let key = load_private_key(\"key.pem\").unwrap();\n\n    let config = ServerConfig::builder_with_provider(default_provider().into())\n        .with_safe_defaults()\n        .with_no_client_auth()\n        .with_single_cert(cert_chain, key)\n        .unwrap();\n\n    let listener = TcpListener::bind(\"0.0.0.0:4433\").unwrap();\n\n    for stream in listener.incoming() {\n        let tcp = stream.unwrap();\n        let mut server = ServerConnection::new(Arc::new(config)).unwrap();\n        let mut tls = Stream::new(\u0026mut server, tcp);\n\n        // Read HTTP request over TLS\n        let mut request = String::new();\n        tls.read_to_string(\u0026mut request).unwrap();\n        tls.write_all(b\"HTTP/1.1 200 OK\\r\\nContent-Length: 12\\r\\n\\r\\nHello Zeta!\\n\").unwrap();\n    }\n}\n```\n\n## Crypto Providers\n\nZTLS supports pluggable cryptographic backends:\n\n```zeta\nuse @crypto/ztls::crypto::ring::default_provider;  // Default (ring-compatible)\nuse @crypto/ztls::crypto::aws_lc_rs::default_provider;  // AWS-LC (FIPS capable)\n```\n\n## TLS Versions\n\n```zeta\nuse @crypto/ztls::ProtocolVersion;\n\nfn main() {\n    // Enable only TLS 1.3\n    let config = ClientConfig::builder_with_provider(default_provider().into())\n        .with_safe_defaults()\n        .with_protocol_versions(\u0026[ProtocolVersion::TLSv1_3])\n        .with_root_certificates(root_store)\n        .with_no_client_auth();\n}\n```\n\n## API Overview\n\n| Function / Type | Description |\n|----------------|-------------|\n| `ClientConfig` | TLS client configuration (certificates, cipher suites, versions) |\n| `ServerConfig` | TLS server configuration |\n| `ClientConnection` | Established TLS client session |\n| `ServerConnection` | Established TLS server session |\n| `Stream` | Bidirectional TLS stream wrapping a TCP socket |\n| `ServerName` | DNS name for SNI and certificate verification |\n| `CryptoProvider` | Pluggable cryptographic backend |\n| `RootCertStore` | Trusted certificate authority store |\n| `Certificate` | X.509 certificate |\n| `PrivateKey` | Private key (RSA, ECDSA, Ed25519) |\n| `Tls12` / `Tls13` | Protocol version-specific state machines |\n\n## Features\n\n- **TLS 1.2** and **TLS 1.3** — both client and server\n- **Multiple crypto backends** — ring-compatible default, AWS-LC for FIPS\n- **Certificate validation** — webpki-based chain verification, CRL support\n- **SNI** — Server Name Indication for virtual hosting\n- **Session resumption** — faster reconnects\n- **ALPN** — Application-Layer Protocol Negotiation (HTTP/2, etc.)\n- **QUIC integration** — TLS 1.3 for QUIC transport\n- **Post-quantum key exchange** — ML-KEM (Kyber) via AWS-LC backend\n\n## Tips\n\n- Always use `with_safe_defaults()` to get a secure baseline\n- For production, load root certificates from the system bundle or webpki-roots\n- Session resumption dramatically reduces handshake latency on reconnects\n- Use `Stream` for simple read/write; use `split()` for separate read/write halves\n- Test TLS configurations with badssl.com or test vectors before deploying\n\n## License\n\nMIT OR Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurphsicles%2Fztls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmurphsicles%2Fztls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurphsicles%2Fztls/lists"}