locked
Could not establish trust relationship for the SSL/TLS secure channel & 404 Error Web Exception RRS feed

  • Question

  • I have created a WCF service. and I tested it using WCFTestClient service client url :"http://localhost:234/service.svc it works" however when I enter the service url https://prddb02:14448/service.svc in WCFTestClient the error is:

    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.    The remote certificate is invalid according to the validation procedure.

    Can i test the https url in wcf test client?It has certificates for the https and i have certificates for the current user.Do i need to install it for local machine ??

    Moreover when the client is awaiting for httpGetresponse from service url (https://prddb02:14448/service.svc) it returns 404 error.

    What can be the reason for these errors?

    Enlighten me on these issues.

    Monday, December 14, 2015 6:00 PM

Answers

  • Hi Tough Character,

    Perhaps, you can post your web.config file about this issue.

    Then I can test it in my machine.

    According to this case, based on the error message, I suggest you need to add

    the certificate in the "Trusted Root Certificate Authorities" folder, that means the

    local computer will trust that certificate now.

    For more information, please refer to the following articles:

    1.How to: Configure an IIS-hosted WCF service with SSL

    https://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx

    2.Seven simple steps to enable HTTPS on WCF WsHttp bindings

    http://www.codeproject.com/Articles/36705/simple-steps-to-enable-HTTPS-on-WCF-WsHttp-bindi.

    Best Regards,

    Wanjun Dong


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    • Proposed as answer by Grady_Dong Thursday, December 24, 2015 7:27 AM
    • Marked as answer by Grady_Dong Thursday, December 24, 2015 9:34 AM
    Tuesday, December 15, 2015 6:02 AM

All replies

  • Hi Tough Character,

    Perhaps, you can post your web.config file about this issue.

    Then I can test it in my machine.

    According to this case, based on the error message, I suggest you need to add

    the certificate in the "Trusted Root Certificate Authorities" folder, that means the

    local computer will trust that certificate now.

    For more information, please refer to the following articles:

    1.How to: Configure an IIS-hosted WCF service with SSL

    https://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx

    2.Seven simple steps to enable HTTPS on WCF WsHttp bindings

    http://www.codeproject.com/Articles/36705/simple-steps-to-enable-HTTPS-on-WCF-WsHttp-bindi.

    Best Regards,

    Wanjun Dong


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    • Proposed as answer by Grady_Dong Thursday, December 24, 2015 7:27 AM
    • Marked as answer by Grady_Dong Thursday, December 24, 2015 9:34 AM
    Tuesday, December 15, 2015 6:02 AM
  • Hi ,

    I am able to hit the url in browser and could see the wsdl.404 error what i was getting is also fixed.

    Wrong one:

    <endpoint address="json" binding="webHttpBinding" contract="Contract.IService" behaviorConfiguration="web" bindingConfiguration="webHttpBinding"></endpoint>

    Right One:

    <endpoint address="" binding="webHttpBinding" contract="Contract.IService" behaviorConfiguration="web" bindingConfiguration="webHttpBinding"></endpoint>

    But the issue now is i am not able to connect to the server as its throwing the error in the error log as :

    "could not establish trust relationship for ssl/tls secure channel with authority prddb02:14448/service.svc.

    Server stack trace: 
       at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at IBacker.AttainCampaigns()
       at BackerClient.AttainCampaigns()

    stack trace approximately looks like this.

    One more silly question it might be in my web.config i have

    <client>
    <endpoint address="https://******.****-***/*****_*****?SOAP"
    binding="basicHttpBinding" bindingConfiguration="CodeItSoap"
    contract="Service.CodeItSoap" name="CodeItSoap" />
    </client>

    Could you please confirm me the endpoint address should be the url of service i.e "https://prd220:14448/service.svc" or "https://servicetest-asia/***_**?SOAP"(Third Party web service that i am consuming to get my output.)

    Tuesday, December 15, 2015 4:05 PM
  • Hi Tough,

    I answered this question on  another thread which you posted.

    Best Regards,

    Wanjun Dong


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, December 17, 2015 12:29 PM