C# - Webservise Gives 401 Error On Https?
May 5, 2010I am using webservice in Jquery code,My webservice works fine when it is working on the http:// . It gives me the 401 (unauthorized) error when it running on the https://
View 1 RepliesI am using webservice in Jquery code,My webservice works fine when it is working on the http:// . It gives me the 401 (unauthorized) error when it running on the https://
View 1 RepliesThis is in VS 2005. And IIS is 6.0. I am trying to use Self signed certificate for HTTPS. In the code i am redirecting from http to https for few pages. It is nt working fine. and in the IIS manager, for each page that i want HTTPs, i have changed its setting by checking "Require Secure Channel(SSL)" and "Require 128 bit encryption".
public void setSecureProtocol()
{
string redirectUrl = null;
bool bSecure = true;
bool SecureConnection = true;
if (bSecure && SecureConnection)
redirectUrl = Request.Url.ToString().Replace("http:", "https:");
else
if (!bSecure && SecureConnection)
redirectUrl = Request.Url.ToString().Replace("https:", "http:");
if (redirectUrl != null)
Response.Redirect(redirectUrl);
}
Pages throw me an error like this The page must be viewed over a secure channel The page you are trying to access is secured with Secure Sockets
Layer (SSL).
Please try the following:
* Type https:// at the beginning of the address you are attempting to reach and press ENTER.
HTTP Error 403.4 - Forbidden: SSL is required to view this resource. Internet Information Services (IIS)Internet Information Services (IIS) When i try to put https in the start of the URl, it wont call. I have no idea whats wrong in here. Here, Its not redirecting from http to https. For the pages that i am not redirecting in the code behind, and changing in the IIS, i can see the HTTPS when i check the two checkboxes. Internet Information Services (IIS)
I am trying to deploy a wcf service. I have created a simple service, basically I have created a new wcf service and tried to deploy it however I get this error
The type 'WCF_Application.Service1', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
I am trying to deploy my service to a subdomain like
https://services.mydomain.com/business
My config looks like this
[Code]....
we have a situation where we need to host two certificates on the same server and because we can't have two different certificates on the same server running off the same port we have assigned one certificate run through another port, which is 4443.
So the URL to our web app is now....
[URL]
If I punch this into a web browser I can access it fine, however, if I create a web reference using this URL in Visual Studio (2005) it can create the web reference fine and it builds ok. But whenever I call a web method on this service instance I get a HTTP 404 page not found Exception.
Is there any properties I need to set on the web service object to get this to work? I'm confused as to why it's not working.
I have a problem with the below one. This Javascript:void(0) is stopping me from showing the page securely with https. What is it actually? I have no idea about javascript.
var clear="js/clear.gif"; //path to clear.gif
document.write('<script type="text/javascript" id="ct" defer="defer" src="javascript:void(0)"></script>')
This file has the name js/unitpngfix.js*...i tried to see if it is being used anywhere. Yes, it is being used and all the pages that use this will not be shown as https. In the Master page, it was used like this
I am trying to call web reference "A" in an application.
The web reference "A" will then call a function in another web reference "B" through HTTPS connection (require certificate).
Then I keep getting the following error:
An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in System.Web.Services.dll
I have a WCF Service that I have boiled down to next to nothing because of this error. It is driving me up the wall. Here's what I have now.
A very simple WCF service with one method that returns a string with the value, "test".
A very simple Web app that uses the service and puts the value of the string into a label.
A web server running IIS 6 on Win 2003 with a SSL certificate.
Other WCF services on the same server that work. I publish the WCF service to it's https location I run the web app in debug mode in VS and it works perfectly. I publish the web app to it's https location on the same server the WCF service resides under the same SSL certificate I get, "The remote server returned an error: (403) Forbidden" I have changed almost every setting in IIS as well as the WCF and Web apps to no avail. I have compared setting in the WCF services that work and everything is the same.
Below are the setting in the web.config for the WCF Service and the WEB app: It appears the problem has to do with the Web app but I am out of ideas.
WCF Service:
<system.serviceModel>
<bindings>
<client />
<services>
<service behaviorConfiguration="Ucf.Smtp.Wcf.SmtpServiceBehavior" name="Ucf.Smtp.Wcf.SmtpService">
<host>
<baseAddresses>
<add baseAddress="[|URL]" />
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="Ucf.Smtp.Wcf.ISmtpService" bindingConfiguration="SSLBinding">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Ucf.Smtp.Wcf.SmtpServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" httpsHelpPageEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
Web App:
<system.serviceModel>
<bindings><wsHttpBinding>
<binding name="WSHttpBinding_ISmtpService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
establishSecurityContext="true" />
</security>
</binding>
<client>
<endpoint address="[URL]"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISmtpService"
contract="SmtpService.ISmtpService" name="WSHttpBinding_ISmtpService">
<identity>
<dns value="localhost" />
</identity>
</client>
</system.serviceModel>
We have an application built on ASP.NET MVC 1.0 which, once deployed, should be accessed with HTTPS. I tried few approaches for HTTPS but I have a few questions.:My home page does not need to be Secured (HTTPS), but rest of the hyperlinks following it will be Secured.I read about the action method attribute [requiresHTTPS] however I want to understand what happens to that tag during development on local machine. In a development enviroment, how do I install a certificate on a dev machine/virtual directory to code and test my changes.So this application is complex in nature and we have around 13 controllers and 50 action methods. This application will have information like Credit card numbers since we do accept payment through this website.
View 1 RepliesBoss want me to change all applications from http:// to https:// to make sites more secure.What steps should I take?
View 4 RepliesI am using a Self signed certificate for HTTPS. I have it ready. what should be changed in IIS and also what should be changed in the code for https to come into affect. I need https for some pages(not all).
View 2 RepliesI am creating a website in Visual Studio 2010 for ASP.NET 4.0 written in C#.
I have a Global.asax file with a method to force specific pages or directories to use https. Then in the web.config file, I define which pages and directories should use https.
The problem I am running into is content not coming over as https even though the URL is https, so IE gives a security warning. We do have a valid cert on the domain. The security warning pop up says, "Do you want to view only the webpage content that was delivered securely? This webpage contains content that will not be delivered using a secure HTTPS connection, which could compromise the security of the entire webpage." If users choose Yes, then parts of the applications do not work.
Is there a way that I can force the content (images, JavaScript files included in the page, etc) to come over as https? All the files are on the web server, so I am not trying to include outside resources (like not displaying a video or image from another site, it is all on my site's web server). I want to avoid absolute URLs in my code because some of the applications are complex and I cannot find all the places where resources are being called.
I want to redirect http to https. I tried this one,but I have one problem, I have to redirect to another page. The request.url gives the current page, whereas I need to redirect to another page. How do I do that.
if(!Request.IsSecureConnection)
{
string redirectUrl = Request.Url.ToString().Replace("http:", "https:");
Response.Redirect(redirectUrl);
}
i want to send sms by using http/https,can nay one tell me hoe can i do this ?
View 1 RepliesI have very much experience of asp.net developement. But i have never dealt with https. In my one project i require 2/3 page with https. So please any one can explain me how i can start with https. Please explain me in detail about about developement cycle, and any other if there is any settings.
View 2 RepliesI have trouble to deploy a mvc site to IIS 6.0. If I deploy it in "simple" http, there is no problems, i can browse my pages, everything's fine...But my site need "https" : so I enable SSL and security certificates, then the site crashes : it display an error 503 : Service temporary unavalaible...Server is a Virtual Machine, if i try to access to IIS in WM (typing "https://localhost/ in a browser), it displays "Connexction was aborted" : Not the same error, but not very different neither...I'm not very familiar with IIS configuration, is there something I missed in config ? Why site is working in http and not in https ?
View 2 RepliesI am trying to consume a webservices which are located at https://TestServices/ServiceList.asmx. When I try to add a service reference to my C# library class project my app.config file looks like below:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="TestServicesSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
[code]...
How i can implement https login in asp.net and C#
View 3 Repliesi'm creating an Asp.Net application and i need to load an UserControl via https. So, in my page i'm loading it with the following code:
...
<%@ Register src="../../pages/controls/bar.ascx" tagname="bar" tagprefix="uc1" %>
<html>
<body>[code]......
Here the UserControl is correctyle loaded via http. So what should i do to load it from the same position but via the https protocol (the certificate is already configured)?
I need to create an ASP.net web page application displays a report based on XML data.
I'm told that I must get my XML data from https://www.example.com/foo.xml. I would like for my ASP.net application to get the data server side, interpret it, and display a report.
I need to know to things:
1) How do I make the .net framework retrieve the XML data from https://www.example.com/foo.xml at run-time.
2) How do I get the data set to an appropriate object type so that my program can read it?
Actuall .net web application run through http protocal.suppose if we want use like Ftp or https means how can we set that protocal?
View 2 RepliesAs part of a master page template, several sites include a login control. Since the site is served over HTTP, I want the login control, once a successful login has been achieved, to resolve to a portal served over HTTPS.The closest I've seen to achieve this may be here, but I'm not entirely clear on its implementation.Can I get some feedback or suggestions on this?Of course, a simple "Login" link on all pages that point to a login paged served over HTTPS is another solution, but this is not what I'm looking for.
View 1 RepliesI can plug a http url into the adrotator fine but everytime I plug an https url in it give me a "cannot find advertisement file or file is invalid. I know these https urls are fine - I've checked them out. .
[Code]....
How to achieve this security feature which is shown in url bar (https) ?
View 1 RepliesI have an asp.net web service which has SSL enabled via IIS. It works fine if the user uses https, however I have a user that insists on using http on the url.
What I'd like to do is have the web service (asmx) do the equivalent of the response.redirect to change http to https automatically.
I don't believe that I can do this from a web service so does anyone know a of a similar solution for web services.
if someone in here could write a script similar to the one on https://www.spalding-labs.com/Secure/Order.aspx . . . I have no idea how to or even where to start.
View 1 Replies