This is a migrated thread and some comments may be shown as answers.

The remote certificate is invalid according to the validation procedure.

3 Answers 758 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
towpse
Top achievements
Rank 2
towpse asked on 26 Nov 2009, 06:40 PM
Just moved my web app up to a staging environment and I'm getting this error. I suspect it has something to do with an IIS error I was getting locally on my machine and used the following code to resolve it.
It seems that this is not working on our staging environment. Not sure how to resolve at this point. Maybe someone can offer some suggestions.

[AuthenticationException: The remote certificate is invalid according to the validation procedure.]
   System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception) +1425171



[WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.]
   System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request) +302
   System.Net.WebClient.UploadString(Uri address, String method, String data) +170
   System.Net.WebClient.UploadString(String address, String method, String data) +35
   Telerik.Web.UI.SchedulerWebServiceClient.GetResources() +460




[Exception: Unable to retrieve response message]
   Telerik.Web.UI.SchedulerWebServiceClient.GetResources() +622









Setup web service in rad scheduler:
<WebServiceSettings Path="SchedulerWebService.asmx"   
                ResourcePopulationMode="ServerSide" /> 

Handle on resource populating 

 

 

 

OnResourcesPopulating="RadScheduler1_ResourcesPopulating"  

        protected void RadScheduler1_ResourcesPopulating(object sender, Telerik.Web.UI.ResourcesPopulatingEventArgs e)  
        {  
            HttpCookie cookie = FormsAuthentication.GetAuthCookie(User.Identity.Name, false);  
            string cookieHeader = string.Format("{0}={1}", cookie.Name, cookie.Value);  
            e.Headers.Add(HttpRequestHeader.Cookie, cookieHeader);  
        } 

3 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 30 Nov 2009, 01:59 PM
Hello,

Since you're accessing the RadScheduler web service via HTTPS, you'll need to handle the certificate validation using the ServerCertificateValidationCallback.

This is a short sample. Be sure to actually verify the certificate in the actual production code.

ServicePointManager.ServerCertificateValidationCallback = ValidateCertificate;
 
// ...
 
protected virtual bool ValidateCertificate(Object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
    if (errors == SslPolicyErrors.None)
        return true;
 
    return false;
}

I hope this helps.

Greetings,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mehmet
Top achievements
Rank 1
answered on 16 Sep 2015, 01:52 PM

Hi Tsvetomir,

I am facing the same issue and I have to find out what to do asap. 
This is how we define the web service method call

<WebServiceSettings Path="Schedule/SchedulerWebService.asmx" ResourcePopulationMode="ServerSide">

Where is that above example snippet code supposed to be stated ? global asax ???  

Thank you

0
Plamen
Telerik team
answered on 21 Sep 2015, 05:47 AM
Hi,

Since it is a global "setting" it would be preferred to set it in the Application_Start method in Global.asax. Yet this is a rather general issue that is not related to RadScheduler so I would recommend you to refer to some other ASP. NET forum.

Regards,
Plamen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
towpse
Top achievements
Rank 2
Answers by
T. Tsonev
Telerik team
Mehmet
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or