Golang API wrapper for cryptcheck.fr
Many of you know the SSLLabs site. Built by Qualys, Inc., it enables anyone to test various TLS-related parameters for given website running on port 443 (the default for TLS). But did you know there is also the cryptcheck.fr one? Formerly known as Imirhil, it allow not only for
https websites to be tested but also SMTP, IMAP, SSH and general TLS (using a different port like a few API do) ones.
Cryptcheck also has an API to get the information programmatically and I just wrote a Golang library for its API. It is named — not very original I know — as
github.com/keltia/cryptcheck and can be found on Github like many Go modules.
Like many Go libraries and utilities, it is very easy to install:
I use this form because in addition to the library itself, there is a small command included.
The current version of the API wrapper is v1.2.0 (see here)
Like the README.md shows, usage is very easy, there are only to main functions,
GetDetailedReport. You have to initialize the client first of course:
1 2 3 4 5
You can also pass parameters to
NewClient() to change defaults:
1 2 3
Changeable parameters include the log level for verbosity (
Log can be 0, 1 or 2) and whether you want to force a re-check of the site to avoid getting a cached version. (
Refresh: true). See the
I have not included a generic
GetGrade() (without the need to create the client first) because it means no default can be overriden which does make testing rather complicated. Its code, in case you need this, is trivial:
1 2 3
For convenience, I have also written the
getgrade utility (found in
cmd/getgradeof course) if you just want a nice example and a quick reading:
1 2 3 4
You can run
getgrade with the
-d option, in which case you will get a JSON dump of the whole report.
If you like this module, you can “star” on github, fork it, etc. It is under the BSD 2-clause license.
As of v1.x,
cryptcheck only implements version 1 of the Cryptcheck API (from
tls.imirhil.fr), the second and more complete version is not yet usable nor really documented (as per its author — Aeris).
I use the Semantic Versioning numbering scheme for this API to facilitate developers’ usage and maintenance.
It is also
vgo-compatible and includes the
vgo metadata. See this series of articles for more details.
vgo aims to be the future scheme to properly manage module dependencies as proposed by Russ Cox.
Thanks to Aeris for creating both site and API and not getting too annoyed at my constant questionning and asking for changes & features :)