cert_util

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: BSD-3-Clause Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

cert_util GoDoc

Functions

  • not_after(hostname, ip:port) - returns unix timestamp for hostname's ssl certificate expiration date. If a second argument will not be passed then will be used default (hostname:443).

Examples

local cert_util = require("cert_util")

local tx, err = cert_util.not_after("google.com", "64.233.165.101:443")
if err then error(err) end
if not(tx == 1548838740) then error("error!") end

Documentation

Overview

Package cert_utils provides utility for checking ssl-certs in lua.

Example (Package)

cert_util.not_after("host", <ip:port>)

state := lua.NewState()
Preload(state)
time.Preload(state)
source := `
    local cert_util = require("cert_util")
    local time = require("time")
    local tx, err = cert_util.not_after("google.com", "64.233.165.101:443")
    if err then error(err) end
    print(tx > time.unix())
`
if err := state.DoString(source); err != nil {
	log.Fatal(err.Error())
}
Output:
true

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(L *lua.LState) int

Loader is the module loader function.

func NotAfter

func NotAfter(L *lua.LState) int

NotAfter lua cert.not_after(hostname, <ip>) returns (unixts cert_not_after, err)

func Preload

func Preload(L *lua.LState)

Preload adds cert_util to the given Lua state's package.preload table. After it has been preloaded, it can be loaded using require:

local cert_util = require("cert_util")

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL