Documentation
¶
Overview ¶
Package ssllabs is the library behind the ssllabs command line: the HTTP client, request shaping, and the typed data models for the SSL Labs API (api.ssllabs.com/api/v3).
The Client sets a real User-Agent, paces requests at 2 s intervals (SSL Labs enforces concurrency limits), and retries transient 429 / 5xx failures. Build your endpoint calls on top of Get.
Index ¶
Constants ¶
const BaseURL = "https://api.ssllabs.com/api/v3"
BaseURL is the root every API request is built from.
const DefaultUserAgent = "ssllabs-cli/dev (+https://github.com/tamnd/ssllabs-cli)"
DefaultUserAgent identifies the client to SSL Labs.
const Host = "api.ssllabs.com"
Host is the domain this driver claims in the URI scheme.
const SiteURL = "https://www.ssllabs.com/ssltest/analyze.html"
SiteURL is the human-readable SSL Labs test page used by Locate.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assessment ¶
type Assessment struct {
Host string `kit:"id" json:"host"`
Port int `json:"port"`
Status string `json:"status"`
StartTime int64 `json:"start_time"`
Endpoints []Endpoint `json:"endpoints"`
}
Assessment is the top-level result from /analyze.
type Client ¶
type Client struct {
HTTP *http.Client
UserAgent string
// Rate is the minimum gap between requests.
Rate time.Duration
Retries int
// contains filtered or unexported fields
}
Client talks to the SSL Labs API over HTTPS.
func NewClient ¶
func NewClient() *Client
NewClient returns a Client with the default configuration.
func (*Client) Analyze ¶
Analyze calls /analyze for the given hostname. When fromCache is true it passes startNew=off&fromCache=on&maxAge=12. When fromCache is false it passes startNew=on.
type Domain ¶
type Domain struct{}
Domain is the SSL Labs driver.
func (Domain) Classify ¶
Classify turns a hostname or ssllabs.com URL into (type, id). "google.com" or "google.com:443" → ("host", "google.com")
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the matched hostnames, and the binary identity.