added support for CT over http for testing

This commit is contained in:
Ian Foster 2018-07-07 14:11:29 -07:00
parent e5fd2e9efc
commit cfe7adf06c
1 changed files with 38 additions and 32 deletions

View File

@ -14,9 +14,12 @@ import (
"crypto/sha256" "crypto/sha256"
"crypto/x509" "crypto/x509"
"encoding/base64" "encoding/base64"
"flag"
"time" "time"
) )
var http_flag = flag.Bool("http", false, "Connect to CT logs over http instead of https, useful for testing")
type LogInfoFile struct { type LogInfoFile struct {
Logs []LogInfo `json:"logs"` Logs []LogInfo `json:"logs"`
} }
@ -30,6 +33,9 @@ type LogInfo struct {
} }
func (info *LogInfo) FullURI() string { func (info *LogInfo) FullURI() string {
if *http_flag {
return "http://" + info.Url
}
return "https://" + info.Url return "https://" + info.Url
} }