none
Windows Service Will not Connect RRS feed

  • Question

  • Hello all, I have a windows service that is unable to connect to a webservice and I receive this error:

    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
        at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
       at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

    What is strange is that if I run the application as a console application with an identical code base, it works perfectly.  It is only when I install it as a windows service when I get this error.  Does anyone have any ideas?

     

     

     

    Thursday, January 6, 2011 7:44 PM

Answers

  • http://www.bing.com/search?q=site%3Aforums.asp.net+Could+not+establish+trust+relationship+for+the+SSL%2FTLS+secure+channel.&form=QBRE&qs=n&sk=

    This has nothing to do with CLR, the engine that merely JIT your code into native code, by the way.

    ASP.Net is running without a user logged on so SSL/TLS certificate cannot be stored in the user's profile.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by eryang Tuesday, January 11, 2011 1:35 AM
    Thursday, January 6, 2011 9:25 PM
  • The forum most related questions are answered, looks like the ASP.Net security forum.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by eryang Tuesday, January 11, 2011 1:35 AM
    Friday, January 7, 2011 3:47 PM

All replies

  • http://www.bing.com/search?q=site%3Aforums.asp.net+Could+not+establish+trust+relationship+for+the+SSL%2FTLS+secure+channel.&form=QBRE&qs=n&sk=

    This has nothing to do with CLR, the engine that merely JIT your code into native code, by the way.

    ASP.Net is running without a user logged on so SSL/TLS certificate cannot be stored in the user's profile.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by eryang Tuesday, January 11, 2011 1:35 AM
    Thursday, January 6, 2011 9:25 PM
  • Which forum should I post to then?  I have search and search and can not seem to figure out why this is happening. 
    Friday, January 7, 2011 12:27 PM
  • The forum most related questions are answered, looks like the ASP.Net security forum.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by eryang Tuesday, January 11, 2011 1:35 AM
    Friday, January 7, 2011 3:47 PM
  •  

    We temporarily mark a reply since the thread idle for a long time, please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.


    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 11, 2011 1:35 AM