diff --git a/src/Runner.Listener/Configuration/ConfigurationManager.cs b/src/Runner.Listener/Configuration/ConfigurationManager.cs index cbea73b17..a2fe2a312 100644 --- a/src/Runner.Listener/Configuration/ConfigurationManager.cs +++ b/src/Runner.Listener/Configuration/ConfigurationManager.cs @@ -522,8 +522,8 @@ namespace GitHub.Runner.Listener.Configuration private async Task GetTenantCredential(string githubUrl, string githubToken) { var gitHubUrlBuilder = new UriBuilder(githubUrl); - var githubApiUrl = $"https://api.{gitHubUrlBuilder.Host}/actions/runner-registration"; - using (var httpClientHandler = HostContext.CreateHttpClientHandler()) + var githubApiUrl = $"{gitHubUrlBuilder.Scheme}://api.{gitHubUrlBuilder.Host}/actions/runner-registration"; + using (var httpClientHandler = HostContext.CreateHttpClientHandler()) using (var httpClient = new HttpClient(httpClientHandler)) { httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("RemoteAuth", githubToken);