| 41 | ) |
| 42 | |
| 43 | func TestGetTrust(t *testing.T) { |
| 44 | a, ctx := test.New(t) |
| 45 | |
| 46 | s, err := NewServer(ctx, componenttest.NewComponent(t, &component.Config{}), ServerConfig{}) |
| 47 | if !a.So(err, should.BeNil) { |
| 48 | t.FailNow() |
| 49 | } |
| 50 | |
| 51 | for _, addr := range []string{ |
| 52 | "thethingsnetwork.org:443", |
| 53 | "https://thethingsnetwork.org:443", |
| 54 | "https://thethingsnetwork.org", |
| 55 | } { |
| 56 | cert, err := s.getTrust(addr) |
| 57 | a.So(err, should.BeNil) |
| 58 | a.So(cert, should.NotBeNil) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | type mockGatewayClientData struct { |
| 63 | ctx struct { |