Sample code for 30+ languages & platforms
Zig

Require that the Web Server's SSL Certificate is Non-Expired and the Signature is Valid

Demonstrates setting the RequireSslCertVerify property to require that the web server's SSL/TLS certificate is non-expired and that the certificate's signature is valid.

Chilkat Zig Downloads

Zig
const std = @import("std");
const chilkat = @import("chilkat");

pub fn main(init: std.process.Init) !void {
    const alloc = init.arena.allocator();

    // This example assumes the Chilkat HTTP API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    const url = "https://chilkatsoft.com";

    const http = try chilkat.Http.init();
    defer http.deinit();
    http.setRequireSslCertVerify(true);

    _ = http.quickGetStr(alloc, url) catch {
        std.debug.print("{s}\n", .{try http.getLastErrorText(alloc)});
        return;
    };

    std.debug.print("Success.\n", .{});
}