HTTPS handshake not happening from IIS - c#

I am having an application in which I am calling an external webservice.
There is a PFX file provided by the provider.
We are attaching the PFX file using X509Certificate2.
The application runs from Visual studio IIS express. But when pointed to IIS. It will start throwing 403 Forbidden error in the same Machine.
We have added the authentication Headers and Network credentials. But in IIS it will not work. The same exact copy works in Visual Studio.
This used to work before from IIS too. But, recently it stopped and it is not running again. Providers say they haven't changed anything.
NOTE: We have another REST service running in the same machine inside the same IIS without any errors. Both service is having similar codes and fiddler also is giving similar requests from Visual studio and IIS
Full error what I get
System.Net.WebException: The request failed with HTTP status 403: Forbidden. at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean, asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at
Production.CompanyInfoWebService.getCompany(wsNumberRequest compInfoRequest) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\test\9b73ec26\5a34d414\App_WebReferences._jpe17z6.0.cs:line 477
at _Default.ButtonFetch_Click(Object sender, EventArgs e) in d:\TestWebsites\app_test\Default.aspx.cs:line 61

Related

The remote server returned an error: (401) Unauthorized. while publishing dev code to production

I am working on the provider hosted app and tried to publish my development code to production i am getting the following error
while publishing the code to production i have changed the client id and secret of production in web .config
changed the client id in appmanifest.xml i got the error as invalid jwt token issue then i have created a new client secret then appended into dev code and published to production publishing profile .after publishing the code if i try to open tha app i am getting the error as displayed on the image .
needed to help to resolve the issue.
Thanks in advanceenter image description here

Callback request failed due to an internal server error after publishing a website Through IIS

I have implemented my code and it works fine in visual studio 2015 but when I deploy the web site to the IIS. It Work fine in my local machine.
While opening other system thorugh my ip it does not show any validation message. It shows error message is "Callback request failed due to an internal server error." doesn't view my message.
can any one help me
Simple mistake go to web Config file
change to
<customErrors mode="Off" />
may be it will work

SignalR issues with URL

I'm having an issue that I can't seem to figure out. Thank you for any assistance you may provide.
I have a Server 2008 R2 SP1 server that is running a .net application that we are trying to implement SignalR on. It works on 1 of the 3 servers. The URL I have is
http://%SITENAME/signalr/negotiate?clientProtocol=1.4&connectionData=%5B%7B%22name%22%3A%22mediahub%22%7D%5D&_=1452535854677
The error I found in the logs is
2016-01-11 12:56:58,506 [65] ERROR ASP.global_asax [(null)] -
MESSAGE: A potentially dangerous Request.Path value was detected from the client (&).
SOURCE: System.Web
URL: http://%SITENAME%/signalr/negotiate clientProtocol=1.4&connectionData=[{"name":"mediahub"}]&_=1452536862615
REFERRER:
FORM:
QUERYSTRING:
TARGETSITE: Void ValidateInputIfRequiredByConfig()
STACKTRACE: at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)
= = =
Its on a server 2008 R2 sp1 server. I've found lots of instructions but haven't found this issue specifically.
I went into the web config and turned on displaying the compilation errors. I hit this url http://%SITENAME/signalr/negotiate?clientProtocol=1.4&connectionData=%5B%7B%22name%22%3A%22mediahub%22%7D%5D&_=1452535854677 and got an error about the machine.config key. After googling the error, I removed the ,IsolateApps from the web.config on the servers.
Here is the link I followed.
IsolateApps causes Decryption key specified has invalid hex characters

Not able to add HTTPS enabled webservice as Service reference in Visual Studio 2008. Error 403

if in IIS specify "require a clients certificate" while adding a HTTPS enabled WebService as Service reference through Visual Studio 2008, the following exception occured:
There was an error downloading "https://10.95.185.119/service1.asmx". The request failed with HTTP status 403: Forbidden. Metadata contains a reference that cannot be resolved: "https://10.95.185.119/service1.asmx". The HTTP request was forbidden with client authentication scheme 'Anonymous'. The remote server returned an error: (403) Forbidden. If the service is defined in the current solution, try building the solution and adding the service reference again.
In IE i can get WSDL in IE without any problem. If I remove "requirement of the certificate" - all ok!
This problem is repeated when application is running.
help please!
Sounds like you have a proxy between you and the server that requires authentication (windows based I guess). IE will have authenticated in a previous session which is why you're able to see the endpoint.
Visual Studio however, will not have authenticated against this proxy and this is why you're seeing the 403.

PayPal Sandbox Access via Mono

I am trying to use .NET 3.5 app on Visual Studio 2008, running Mono 2.10.2 and Apache (with mod-mono) to perform a PayPal payment. I am using the PayPal sandbox, and the solution works perfectly when I debug or run locally. When running on the server with Mono, it times out after the following lines:
PayPalAPIAASoapBinding ws = PayPalUtils.BuildPayPalWebservice();
SetExpressCheckoutResponseType resp = ws.SetExpressCheckout(req);
with the following error:
System.Net.WebException: The request timed out at System.Net.HttpWebRequest.GetRequestStream () [0x0005f] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System/System.Net/HttpWebRequest.cs:752 at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object[] parameters) [0x00069] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHttpClientProtocol.cs:367
I have run the ssl import for https://www.sandbox.paypal.com, and I have run mozroots import to bring in all ssl certs from Mozilla.
Any ideas or suggestions would be welcome!

Categories

Resources