1

I wrote a small test case to isolate github api authorization errors we are getting. The relevant code is below.

let private authToken = "XX REDACTED XX"

let product: Product.ProductInfo =
{
    GitHubProjectOwner = "Weingartner"
    GitHubProjectName = "automation-test"
}


let testAuth owner project =
async {
    let client = GitHubClient(ProductHeaderValue "WeingartnerDistribution")
    client.Credentials <- Credentials authToken 
    let! user = client.User.Current() |> Async.AwaitTask
    return user <> null
}

[<Fact>]
member x.``Should be able to authenticate with github``() =
    async {
        let owner = product.GitHubProjectOwner
        let project = product.GitHubProjectName
        let! client = GitHubIssue.testAuth owner project
        test <@ client @>
    }
    |> Async.StartAsTask

the authtoken is from a user that has been added with read/write capabilities to the repository and the authtoken is for repo only

enter image description here

I get the following stack trace

System.AggregateException
One or more errors occurred.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_1.<<InvokeTestMethodAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xunit.Sdk.ExecutionTimer.<AggregateAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xunit.Sdk.ExceptionAggregator.<RunAsync>d__9.MoveNext()

System.Net.Http.HttpRequestException
An error occurred while sending the request.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Octokit.Internal.HttpClientAdapter.<SendAsync>d__10.MoveNext() in D:\repos\octokit.net\Octokit\Http\HttpClientAdapter.cs:line 180
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Octokit.Internal.HttpClientAdapter.<Send>d__3.MoveNext() in D:\repos\octokit.net\Octokit\Http\HttpClientAdapter.cs:line 47
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Octokit.Connection.<RunRequest>d__55.MoveNext() in D:\repos\octokit.net\Octokit\Http\Connection.cs:line 582
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Octokit.Connection.<Run>d__54`1.MoveNext() in D:\repos\octokit.net\Octokit\Http\Connection.cs:line 573
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Octokit.ApiConnection.<Get>d__8`1.MoveNext() in D:\repos\octokit.net\Octokit\Http\ApiConnection.cs:line 0

System.Net.WebException
The request was aborted: Could not create SSL/TLS secure channel.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)

I'm pretty sure all is correct. Any idea why I cannot connect? The summary of the error is

Could not create SSL/TLS secure channel.

bradgonesurfing
  • 30,949
  • 17
  • 114
  • 217
  • 1
    Possible duplicate of [The request was aborted: Could not create SSL/TLS secure channel](https://stackoverflow.com/questions/2859790/the-request-was-aborted-could-not-create-ssl-tls-secure-channel) – bradgonesurfing Mar 07 '18 at 14:26
  • Should I vote to close my own issue or just delete it? #meta – bradgonesurfing Mar 07 '18 at 14:27

0 Answers0