Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

URGENT: Can't use web service from ASP.net web application after switching to SSL and Integrated Windows Authentication

Posted on 2006-11-07
5
Medium Priority
?
641 Views
Last Modified: 2012-06-27
I am have an ASP.net 2.0 web application that calls an ASP.net 2.0 web service on the same server in a different directory.  At first the service was open with no encryption and anonymous access was allowed.  The web service worked fine like this.

We recently installed an SSL certifice for the server and I un-checked anonymous access on the directory the web service is in and just left Integrated Windows Authentication.

The web application now reports the following error when calling the web service:

------------------------------------------------------------------------------------------------------------------------------------------------------------------
No connection could be made because the target machine actively refused it

[SocketException (0x274d): No connection could be made because the target machine actively refused it]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1002146
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431

[WebException: Unable to connect to the remote server]
   System.Net.HttpWebRequest.GetRequestStream() +1504525
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +103
   WS_Security.Security.Login(String Acf2Id, String Acf2Password) +63
   ASP.login_aspx.blnCheckUserLogin(String sUser, String sPass) in c:\inetpub\wwwroot\GSS\Login.aspx:52
   ASP.login_aspx.Login1_Authenticate(Object sender, AuthenticateEventArgs e) in c:\inetpub\wwwroot\GSS\Login.aspx:65
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +106
   System.Web.UI.WebControls.Login.AttemptLogin() +105
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
------------------------------------------------------------------------------------------------------------------------------------------------------------------

We have a windows application that also calls the web service.  The following sample code allowed it to work correctly:

Dim ws As New WebServiceName
ws.Credentials = new NetworkCredential("user", "pass", "domain")
ws.DoSomething()

When I used the same code in the web application, nothing changed and I got the same error.

Any help would be greatly appreciated.
0
Comment
Question by:lbyrdjr
  • 2
4 Comments
 

Author Comment

by:lbyrdjr
ID: 17893509
Another thing that I didn't mention was that the windows application that uses the service does not run on the server.  And when I debug the web application on my development machine the web service works fine.  It is only when calling the web service from the web application on the server that fails.
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17893745
The only thing that I can think of is that the windows program that works operates under the credentials of the logged on user but the asp.net app runs under MACHINE\ASPNET. I know you are setting the credentials for the webservice call but maybe this is not working correctly.

Can you modify your webservice to monitor the requests comming in and check the credentials to see what's getting passed in.

If all else fails you couyld use inpersonation in the web.config file.

Good luck
0
 

Author Comment

by:lbyrdjr
ID: 17901257
I found the solution.  It was not really a problem with ASP.net.  As explained to me, the browser settings were set for the primary DNS to point to localhost.  The domain name (DomainName.com and www.DomainName.com) had to be added to the HOSTS file.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18106259
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question