Go to file
Matthew 27732e63c1
formatting
2020-12-23 16:28:41 -05:00
cmd more info to readme and fixes 2020-12-11 00:25:47 -05:00
routes formatting 2020-12-23 16:28:41 -05:00
.gitlab-ci.yml add ci file 2020-12-23 14:38:32 -05:00
Dockerfile add dockerfile 2020-12-22 18:29:18 -05:00
LICENSE add license 2020-12-11 00:22:42 -05:00
Makefile fixes to makefile 2020-12-22 18:31:04 -05:00
README.md more info to readme and fixes 2020-12-11 00:25:47 -05:00
go.mod Initial commit 2020-12-11 00:18:06 -05:00
go.sum Initial commit 2020-12-11 00:18:06 -05:00

README.md

Certificate API

Library of Code sp-us | Board of Directors

This is an HTTP API which provides information on the x509 certificates deployed on TLS sites. You can self-host this yourself, however you're more than welcome to use the public API at https://certapi.libraryofcode.org/

Installation

Run make to build the binary. It'll be installed in build/certificateapi. Simply run this executable.

Environment Variables

By default, the application listens on port 8080. You can change this by setting the PORT environment variable to what you want. When running in production, set this environment variable: GIN_MODE=release

How to Query

Send a GET request to https://certapi.libraryofcode.org with the query parameter q set to equal the site you wish to dial. Ex: https://certapi.libraryofcode.org/?q=www.google.com

Response & Types

Error

If the status !== true, there will be a message field which displays the error.

{
  status: false,
  message: string,
}

200 | SUCCESS

{
  status: true | false,
  subject: {
    commonName: string,
    organization: string[],
    organizationalUnit: string[],
    locality: string[],
    country: string[],
  },
  issuer: {
    commonName: string,
    organization: string[],
    organizationalUnit: string[],
    locality: string[],
    country: string[],
  },
  validationType: 'DV' | 'OV' | 'EV',
  signatureAlgorithm: string,
  publicKeyAlgorithm: string,
  serialNumber: number,
  notAfter: Date,
  extendedKeyUsage: ['All/Any Usages', 'TLS Web Server Authentication', 'TLS Web Client Authentication', 'Code Signing', 'E-mail Protection (S/MIME)'],
  san: string,
  fingerprint: string,
}