aia

package module
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 8 Imported by: 7

README

AIA (Authority Information Access) Transport Go

GoDoc Build Status Go Report Card GolangCI Coverage Status

AIA-Transport-Go provides an http.Transport which uses the AIA (Authority Information Access) X.509 extension to resolve incomplete certificate chains during the tls handshake. See rfc3280 for more details.

Installation

go get github.com/fcjr/aia-transport-go

Usage

tr, err := aia.NewTransport()
if err != nil {
    log.Fatal(err)
}
client := http.Client{
    Transport: tr,
}
res, err := client.Get("https://incomplete-chain.badssl.com/")
if err != nil {
    log.Fatal(err)
}
fmt.Println(res.Status)

Todos

  • Follow single incomplete AIA chain
  • Tests
  • CI & Code Coverage
  • Documentation
  • Chain Caching
  • Certificate Caching
  • Follow all possible issuing urls
  • Benchmarks

Caveats

This library relies on x509.SystemCertPool() to gather the initial system root certificates to validate against. This function is not implemented on windows, however windows will resolve incomplete certificate chains via AIA automatically so this library simply returns a default http.Transport on windows which should be sufficient.^1

Documentation

Overview

Package aia provides an http.Transport which uses the AIA (Authority Information Access) X.509 extension to resolve incomplete certificate chains during the tls handshake. See https://tools.ietf.org/html/rfc3280#section-4.2.2.1 for more details.

Usage

To use simply create a new transport via NewTransport() and use it in your http.Client.

tr, err := aia.NewTransport()
if err != nil {
  log.Fatal(err)
}
client := http.Client{
  Transport: tr,
}
res, err := client.Get("https://incomplete-chain.badssl.com/")
if err != nil {
  log.Fatal(err)
}
fmt.Println(res.Status)

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

func NewTransport() (*http.Transport, error)

NewTransport returns a http.Transport that supports AIA (Authority Information Access) resolution for incomplete certificate chains.

Example
tr, err := aia.NewTransport()
if err != nil {
	log.Fatal(err)
}
client := http.Client{
	Transport: tr,
}
res, err := client.Get("https://incomplete-chain.badssl.com/")
if err != nil {
	log.Fatal(err)
}
fmt.Println(res.Status)
Output:

200 OK

Types

This section is empty.

Jump to

Keyboard shortcuts

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