(port int, hdl http.Handler)
| 93 | } |
| 94 | |
| 95 | func newTLSServer(port int, hdl http.Handler) *httptest.Server { |
| 96 | lis, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", port)) |
| 97 | if err != nil { |
| 98 | panic(err) |
| 99 | } |
| 100 | srv := httptest.NewUnstartedServer(hdl) |
| 101 | srv.Listener = lis |
| 102 | srv.TLS = makeServerTLSConfig() |
| 103 | srv.StartTLS() |
| 104 | return srv |
| 105 | } |
| 106 | |
| 107 | func makePacketBrokerTokenIssuer(ctx context.Context, subject string) (iss string, tok func(aud string) string) { |
| 108 | public, private, err := ed25519.GenerateKey(nil) |
no test coverage detected