2020-10-12 20:34:52 +00:00
|
|
|
// +build ignore
|
2020-09-27 17:50:48 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
2020-09-28 03:49:41 +00:00
|
|
|
"time"
|
2020-09-27 17:50:48 +00:00
|
|
|
|
2020-09-28 22:19:59 +00:00
|
|
|
"git.sr.ht/~adnano/gmi"
|
2020-09-27 17:50:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
host := "localhost"
|
|
|
|
|
2020-09-28 03:49:41 +00:00
|
|
|
duration := 365 * 24 * time.Hour
|
|
|
|
crt, key, err := gmi.NewRawCertificate(host, duration)
|
2020-09-27 17:50:48 +00:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2020-10-12 04:06:20 +00:00
|
|
|
if err := gmi.WriteX509KeyPair(host, crt, key); err != nil {
|
2020-09-27 17:50:48 +00:00
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|