Web Service Test of Posts - SSL error

1

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.

    
asked by anonymous 14.08.2015 / 21:00

2 answers

1

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;
    }
    
14.08.2015 / 21:47
0

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.

    
14.08.2015 / 21:34