mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-10-09 07:35:50 +02:00
Add support for self-signed CA certificates (#2268)
Co-authored-by: Bassem Dghaidi <568794+Link-@users.noreply.github.com> Co-authored-by: Nikola Jokic <jokicnikola07@gmail.com> Co-authored-by: Tingluo Huang <tingluohuang@github.com>
This commit is contained in:
co-authored by
Bassem Dghaidi
Nikola Jokic
Tingluo Huang
parent
068f987238
commit
c569304271
@@ -95,8 +95,8 @@ func TestServerWithSelfSignedCertificates(t *testing.T) {
|
||||
cert, err := os.ReadFile(filepath.Join("testdata", "rootCA.crt"))
|
||||
require.NoError(t, err)
|
||||
|
||||
pool, err := actions.RootCAsFromConfigMap(map[string][]byte{"cert": cert})
|
||||
require.NoError(t, err)
|
||||
pool := x509.NewCertPool()
|
||||
require.True(t, pool.AppendCertsFromPEM(cert))
|
||||
|
||||
client, err := actions.NewClient(configURL, auth, actions.WithRootCAs(pool))
|
||||
require.NoError(t, err)
|
||||
@@ -123,8 +123,8 @@ func TestServerWithSelfSignedCertificates(t *testing.T) {
|
||||
cert, err := os.ReadFile(filepath.Join("testdata", "intermediate.pem"))
|
||||
require.NoError(t, err)
|
||||
|
||||
pool, err := actions.RootCAsFromConfigMap(map[string][]byte{"cert": cert})
|
||||
require.NoError(t, err)
|
||||
pool := x509.NewCertPool()
|
||||
require.True(t, pool.AppendCertsFromPEM(cert))
|
||||
|
||||
client, err := actions.NewClient(configURL, auth, actions.WithRootCAs(pool), actions.WithRetryMax(0))
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user