Someone else has had this problem by referencing the web service for tests and implementations of the post office.
I need to do some validation but I can not execute any method without ssl errors.
Someone else has had this problem by referencing the web service for tests and implementations of the post office.
I need to do some validation but I can not execute any method without ssl errors.
The two methods below are for accepting any certificate that web services are using
private static void SetCertificatePolicy()
{
// Código necessário para acessar serviços remotos
// Evita o erro HTTP 417
ServicePointManager.Expect100Continue = false;
ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidate;
}
private static bool RemoteCertificateValidate(object sender, X509Certificate cert, X509Chain chain,
SslPolicyErrors error)
{
return true;
}
The problem is with the webservice certificate. The certificate is probably self-signed, which makes it marked as 'false' by browsers.
There is not much to do. You can try to force your application / server to accept the false certificate, but it is not guaranteed to work.