C# - WebException Could Not Establish Trust Relationship For The SSL/TLS Secure Channel
Dec 20, 2010
My company has developed a .NET web service and a client dll that uses that web service. The webservice is hosted on our server over ssl and the cert is provided and signed by GoDaddy. We have some clients in a hosted environment that are getting the following error message from the client dll when it tries to access our web service.
System.Net.WebException The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Our fix has been to have them open IE on the server, which is a challenge in and of itself for a lot of the hosted services, and go to the WSDL url. IE then prompts them with a security alert dialog. It says the cert date is valid and a valid name matching the name of the page, but was issued by a company you have not chosen to trust. When they click Yes to proceed, the client dll can then succesfully connect to the web service and operate as normal. why GoDaddy would not have been in there valid publishers list? All of the servers we have running has GoDaddy as a valid authority. I'm guessing, for security reasons, they've uninstalled the authority for GoDaddy, but not totally convinced that there's not some other underlying issue.
Unfortunately, I haven't had much luck trying to recreate this locally. If I go into Internet Options and remove the GoDaddy authorities and hit our service, ssl works just fine. I go back into the list of publishers and GoDaddy gets put right back in. So my second question is, How the heck do you get rid of GoDaddy so I can get an invalid cert warning?
Okay, last question. Is there a way in code I can tell the web service to ignore invalid certs. I've seen some posts on doing this programatically with WCF but not old web services.
View 2 Replies
Similar Messages:
Jul 25, 2010
i have a web application that is using a https webservice and for accessing this webservice i have installed the PFK file into the mmc console in the personal storage folder and also installed in IIS. After installing the PFK file the properties of the installed PFK file shows a warning that "Windows does not have enough information to verify this certificate" but the installation is done with success. After this i go to add the wsdl to my project as service reference, but it shows the error "Could not establish trust relationship for the SSL/TLS secure channel with authority". What is the solution for this?
View 17 Replies
Nov 12, 2010
I have a .net web app hosting in IIS6 with Windows Authentication and anonymous access disabled. The web app is making connection to a SQL Server that is in the same domain, but on a different machine.
I want to have the IIS Worker process acount I_USR_... to be granted access to the SQL Server.
Will this work ?
(Is there a one to one trust ? Or should I make some extra effort to make the trust work ?)
(edit) On this page I read:
IUSR_ must be in the domain, and given proper access to the SQL Server; or, you must disable anonymous access on the site / application - which will allow IIS to pass the users' credentials to SQL Server. Not doing either of these things will result in an error.
View 5 Replies
Sep 6, 2010
IIS 6 installed on Vista (Virtual PC) not member of domain, Visual studio 2008 based website. Active Directory Membership configured in web.config.
Trust level set to Full. Using Login control to authenticate.
[Code]....
View 2 Replies
Nov 3, 2010
I cannot get a successful connectiong to the active directory when logging onto a web form. Here is the code I have in the web.config:
<configuration>
<appSettings/>
<connectionStrings>
[code]...
View 1 Replies
Jul 23, 2010
We're having an error similar to the one detailed here. We get the error noted above when trying to do AD authentication from our .net (3.5) mvc 2 app. This is our first .net mvc app ...
http://forums.asp.net/t/1161047.aspx
- We are re-using a forms auth library written for a .Net 2 app
- that library/app/config used a service account with min. privileges for binding to AD
- This error occurs in VS 2008, have not tried deploying the app to a server yet (a little early for that)
- like the other user at the previously referenced thread, I can get the 'unable to establish ...' error to go away and display the log on page by putting *MY* credentials in instead of the service account (but not successfully authenticate)
- moving the service account into the same AD OU as my account does not seem to change it ... only using my account credentials does.
- trust level is set to full
Is this some odd permissions trick that is new with .Net 3.5 (even though the ADmembershipProvider is still a 2.0 libary)? This should have nothing to do with MVC itself.
Config looks like this (very standard, like every one else's)
[Code]....
The line/portion highlighted in the debug/stacktrace is:
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
View 2 Replies
Aug 3, 2010
We have a ASP.NET site that partially depends on forms authentication for login credentials, however the implementation of IPrincipal is completely custom.
But, when running the site on a particular server (which is somewhat semi-hardened when it comes to security), the app crashes when invoking IPrincipal.IsInRole() with the following messsage:
System.SystemException: The trust relationship between the primary domain and the trusted domain failed.
This indicates a communication error between the web-server and the DC, however since our application doesn't at all utilizes Windows authentication, I don't see why it needs to communicate with the DC.
This is my implementation:
[code]...
EDIT:
I was finally enable to reproduce this error on my dev-machine (i revoked my machine from the DC yesterday, but didn't reproduce it until today)
HttpContext.User is actually a WindowsPrincipal by default it seems, and the error in my code was that I only replace it with CustomPrincipal upon login. Hence, unathenticated users still get the WindowsPrincipal which then fails horribly if you have trust issues on your AD.
I tried changing the default principal by invoking this on appstart
AppDomain.CurrentDomain.SetPrincipalPolicy( PrincipalPolicy.NoPrincipal);
But this doesn't seem to kick in. How do I change the default Principal in ASP.NET?
View 1 Replies
Aug 9, 2010
In my web.config I have:
[Code]....
If I just have ADProvider1 it works, when I add ADProvider2, even though for testing I only use ADProvider1 I get an error: "Unable to establish secure connection with the server" Am I adding the second provider to the membership section incorrectly?
View 11 Replies
Feb 11, 2011
I have to host a wcf service in a medium trust environment.I want to know which bindings are supported while hosting WCF services in medium trust. There is a MSDN article
http://msdn.microsoft.com/en-us/library/bb412171.aspx which talks about partial trust. I am not sure is it the same as medium trust.
View 1 Replies
Jul 13, 2010
My web application will be launched through existing thick client applications. When launched, an HTTP POST request will be generated including information like the userID and additional context information (basically stuff like the target user's name, birthday, etc.).
My plan for authentication is for there to be a look-up table in the database. If the username is already there, automatically login the user, but if there is no entry in the database, redirect the user to an initial login page which will be used to create that database entry.
My question is how to secure this against MITM and other security holes. How can the request generated through the thick client be on an SSL connection? Doesn't an SSL connection have to be authenticated with the username (and password) first? And if so, will the additional context information be publicly exposed until the user is logged in?
View 1 Replies
Oct 25, 2010
I have a browser compatibilty problem with https? I have SSL installed and is in usage. Until today morning, my https part is working well. From then, Https is shown as https(with slashed in red color) saying the page has some insecure content. I have not changed any code and suddenly i see this problem in chrome. In IE 8, i see the same problem but on every page, it shows me a popup if i should allow to opne secure and non secure or just secure. Firefox has no issues . It shows correct https without any problem. I am fed up with it searching all over. Why is this happenening for me in Chrome and IE 8.
View 3 Replies
Oct 24, 2010
I have a custom mini login user control that I have embedded in the top of my website which shows on every page. These pages are non-secure HTTP://. I would like to avoid having to redirect the user to a HTTPS page to perform the login but I definitely don't want to send login credentials to the server in plain text.
I am trying find a method to send the user's login credentials encrypted via https from a non-secure (http) page.
I tried to set the postbackurl for the login button to itself but in https, but the user's input is not retained and the buttonLogin_click is not fired when I set the button postbackurl property. My ASP.net web application is VB.Net framework 4.0
I am assuming this can be done because I see lots of websites where login fields are on available on every page and they are running http and I can believe they are not encrypting the login credentials.
View 3 Replies
Jan 11, 2011
I'm not entirely sure how to explain this, but basically I am trying to use a Silverlight application hosted within an ASP.NET MVC application. I have a basic controller on the MVC side that contains a method which accepts some string parameter and returns an ActionResult (for the purpose of this program, that result is some Json data).
My problem arises when I handle the WebClient.OpenReadCompleted event within the Silverlight control. When the WebClient.OpenReadAsync method is called within this control, it successfully reaches the controller and then reports back to the relevant event handler as expected. However, when it is handled, the event arguments contain an error stating: "The remote server returned an error: NotFound.".
Previously, I have noticed this is caused when some part of my communication URL is incorrect - in this case it is not. From some Googling, I have also noticed that this is a generic error. As such, I'm rather stumped. To make matters more confusing, I use this exact same communication attempt in another part of the program, that retrieves an array of strings, and that works perfectly fine.
see the example code below (due to the nature of this program, I am unable to post the full code).
Silverlight Control
WebClient mClient = new WebClient();
public void RequestData()
{
mClient.OpenReadAsync(new Uri("http://localhost:51234/Home/GetData"));
mClient.OpenReadCompleted += new OpenReadCompletedEventHandler(mClient_OpenReadCompleted);
}
private void mClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
if(!e.Cancelled && e.Error == null) // <-- e.Error here is a WebException
{
var serializer = new DataContractJsonSerializer(typeof(Data));
Data data = (Data)serializer.ReadObject(e.Result);
}
}
MVC Controller - named HomeController and accessed with "Home"
public ActionResult GetData()
{
return Json(new Data(), JsonRequestBehaviour.AllowGet);
}
Note Here, Data contains three members of types; string, string and byte array. For the purpose of serialization, I have exposed all three members through public properties containing both get and set parts. I have also added a public constructor taking no arguments.
UPDATE
I've just tried the same bit of code with different data, and it works fine. I wondered if it was the size of the data (as the first attempt was with very large data), but I don't understand why that would matter if the call managed to hit the controller.
View 1 Replies
Dec 13, 2010
here my code-
private string HttpContent(string url)
{
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
StreamReader sr = new StreamReader(objRequest.GetResponse().GetResponseStream());
string result = sr.ReadToEnd();
sr.Close();
return result;
}
exception comes in 2nd line in objRequest.GetResponse(). If I open it quick watch window I get:
'objRequest.GetResponse()' threw an exception of type 'System.Net.WebException'
"The remote server returned an error:(404) Not Found."
View 5 Replies
Jun 9, 2010
I need to check whether the request will return a 500 Server Internal Error or not (so getting the error is expected). I'm doing this:
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
request.Method = "GET";
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
if (response.StatusCode == HttpStatusCode.OK)
return true;
else
return false;
But when I get the 500 Internal Server Error, a WebException is thrown, and I don't want to depend on it to control the application flow - how can this be done?
View 2 Replies
Nov 1, 2010
I have a web page that uses System.Net.HttpWebRequest class that used to work perfectly fine for 2 years, and then all of a sudden I started to get the following error.[WebException: The operation has timed out] System.Net.HttpWebRequest.GetResponse() +5314029Also, I tried the application on my local machine and it works fine, do you think it is a setting change on my hosting server?I already tried the response.close and it didn't work.
View 10 Replies
Oct 26, 2010
there are thousand of websites on the internet that have live coverage of the channels ,cricket matches.how does they do that? from where does they pick the coverage?
View 1 Replies
Aug 24, 2010
I need to set ASP.NET_SessionId in order to dowload a file from server.
I use the following code
IContextChannel mychannel = (IContextChannel)myService;
using (OperationContextScope scope = new OperationContextScope(mychannel))
{
res = myService.DoSomething();
System.ServiceModel.Channels.MessageProperties messageProperties = ......
View 1 Replies
Nov 15, 2010
I have system with TV tuner card. In my project, I want to stream one of the channel from my system to other users in my LAN.
I don't have any idea how to stream TV channel from TV Tuner Card.
I want to use ASP.NET with C#.
View 2 Replies
Dec 7, 2010
I had YouTube Channel and I Had Web Page on my web site which display this video ,I diplay the viedo in ModalPopupExtender ,and I had problem when I finsihed from displaying this video and close ModalPopupExtender the sound of viedo still displaying.
' id="Image" runat="server" width="96" height="86" alt="Video" />
'>
' type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true" width="400" height="320">
[Code]....
View 1 Replies
Jan 12, 2011
I am going to develop a website in asp.net , in which i will have to display a live streaming of a TV channel.
View 2 Replies
Aug 10, 2010
I have a GUI when i log in i create a cookie and it encrypt it. I am usin SSL.
I check in the Login.aspx page if the cookie is secure, which it is. but then before going to the default page it goes to the Global.ascx page.
Here in the Application_AuthenticateRequest it gets the cookie and decrypts it for the default page..
Now i know that it is getting the same cookie as all the other attributes match the one that was created in the Login.aspx page excet that the secure value is "False".
this is the case for all other pages after default. the value of the cookie.secure is false.
why is this happening as i want all the pages to be secure by SSL.
Also the pages are opening as https not http.
here is my web.config
[code]....
View 1 Replies
Jan 18, 2010
After logging to the mvc site using a secure connection (https), calling actions using https connection show up with the user logged in but calling actions using http it bahaves as if user didn't log on. Since I need to use a virtual directory for https connections(and can't use that directory for http connection) Https links start with: [URL]
View 1 Replies
Sep 17, 2010
I'm working on a legacy web application - frames and a mixture of html, asp and aspx. The entire site is https. For some strange reason when I hit a specific page I get the magic message that says the Page contains both secure and nonsecure items. (IE obviously doesn't want to tell me what those resources are) I have checked the page that's being loaded and there are absolutely no http://... links - everything is relative links.
I have fired up fiddler and checked what's being requested - everything looks fine. I am completely at wit's end here. I have absolutely no idea why I'm getting this message, but it's completely screwing with the site.
View 3 Replies
Aug 31, 2010
I never used linq before and i'm having trouble parsing the xml file at
[Code]....
[Code]....
[Code]....
View 10 Replies