You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My program has this problem,it is a dotnet core application and running on docker container of linux.
when it request tfs api, I am got a error,How to solve this problem?
the error
One or more errors occurred. (GSSAPI operation failed with error - An invalid status code was supplied (Unknown error).)","Code":"999","DocURL":null,"RequestUri":"/api/CodeVersionCtl/GetProjects","RequestBody":"","Result":"System.AggregateException: One or more errors occurred. (GSSAPI operation failed with error - An invalid status code was supplied (Unknown error).) ---> System.ComponentModel.Win32Exception: GSSAPI operation failed with error - An invalid status code was supplied (Unknown error).\n at System.Net.Security.NegotiateStreamPal.AcquireCredentialsHandle(String package, Boolean isServer, NetworkCredential credentia
The source code
public List GetProjects()
{
string projecturl = "http://...:8080/tfs/defaultcollection/_apis/projects";
HttpClient mywebclient = TfsService.GetHttpClient(projecturl);
var responsemsg = mywebclient.GetAsync(projecturl);
string result = responsemsg.Result.Content.ReadAsStringAsync().Result;
JObject jo = (JObject)JsonConvert.DeserializeObject(result);
List list = JsonConvert.DeserializeObject(jo["value"].ToString());
return list;
}
private static HttpClient GetHttpClient(string url)
{
var uri = new Uri(url);
var credentialsCache = new CredentialCache { { uri, "NTLM", new NetworkCredential("user", "pwd", "***.com") } };
var handler = new HttpClientHandler { Credentials = credentialsCache };
var httpClient = new HttpClient(handler) { BaseAddress = uri };
httpClient.DefaultRequestHeaders.ConnectionClose = false;
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
ServicePointManager.FindServicePoint(uri).ConnectionLeaseTimeout = 60 * 1000; // Close connection after one minutes
return httpClient;
}
The text was updated successfully, but these errors were encountered:
andycode112
changed the title
SSAPI operation failed with error - An invalid status code was supplied
SSAPI operation failed with error - An invalid status code was supplied GSSAPI operation failed with error
Oct 24, 2018
This seems like a question well-suited for stack overflow rather than the microsoft/dotnet docker repo. Does the app run outside of a container? Does it work on Linux? The Win32Exception in the call stack is somewhat suspicious in the context of Linux.
Closing as this appears to be an issue with containerizing a specific application rather than a specific issue with the microsoft/dotnet images. If this problem is proven to be something specific to the microsoft/dotnet images, please re-open.
I have solved this problem and adopted the following https://github.com/dotnet/corefx/issues/28961 ,
Add code AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false) at ConfigureServices method of Startup class
My program has this problem,it is a dotnet core application and running on docker container of linux.
when it request tfs api, I am got a error,How to solve this problem?
the error
One or more errors occurred. (GSSAPI operation failed with error - An invalid status code was supplied (Unknown error).)","Code":"999","DocURL":null,"RequestUri":"/api/CodeVersionCtl/GetProjects","RequestBody":"","Result":"System.AggregateException: One or more errors occurred. (GSSAPI operation failed with error - An invalid status code was supplied (Unknown error).) ---> System.ComponentModel.Win32Exception: GSSAPI operation failed with error - An invalid status code was supplied (Unknown error).\n at System.Net.Security.NegotiateStreamPal.AcquireCredentialsHandle(String package, Boolean isServer, NetworkCredential credentia
The source code
public List GetProjects()
{
string projecturl = "http://...:8080/tfs/defaultcollection/_apis/projects";
HttpClient mywebclient = TfsService.GetHttpClient(projecturl);
var responsemsg = mywebclient.GetAsync(projecturl);
string result = responsemsg.Result.Content.ReadAsStringAsync().Result;
JObject jo = (JObject)JsonConvert.DeserializeObject(result);
List list = JsonConvert.DeserializeObject(jo["value"].ToString());
return list;
}
The text was updated successfully, but these errors were encountered: