1

I've been given a Url like:

https://xxxx.gr/xxx/xxx/xxx/xxx?WSDL

to create a consumer.

For testing reasons I've started a new desktop application in C# and when I tried to add the service reference I get the following error:

The request was aborted: Could not create SSL/TLS secure channel.

Then I tried to hit that Url direct from each browser (IE, FireFox, Chrome). They all report that it is insecure connection.

For example, in FireFox I get this info:

https:xxxx/xxx/xxx?WSDL

Peer's Certificate issuer is not recognized.

HTTP Strict Transport Security: false
HTTP Public Key Pinning: false

Certificate chain:

-----BEGIN CERTIFICATE-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END CERTIFICATE-----

I search the web and also SO but I couldn't figure it out.

Is there something I could do or the problem is from service side?

PS I'm completely ignorant about certificates etc.

Thanks.

shadow
  • 1,883
  • 1
  • 16
  • 24

2 Answers2

2

put the certificate into the authors trusted and retry.

C.Fasolin
  • 313
  • 1
  • 4
  • 19
  • If it's not trouble to you, can you be more specific? Thanks anyway. – shadow May 27 '16 at 14:10
  • open internet explorer > tools>internet option> tab content click on certificate button choose tab "Trusterd Publishers" click on import button and fallow the procedures... – C.Fasolin May 30 '16 at 12:23
  • Thank you for your time but I don't have a certificate file to import. After searching I understood that maybe the server administrator (of the service) did not match correct the certificate or it is self-signed (like for intranet use). Either it's possible because it is a test service. For me I think the only thing I can do is to load the service at run time (not add it as service reference) and create all the proxy classes manually. I think, not sure enough. – shadow May 30 '16 at 12:45
0

You can ignore the certificate error if you just want to be able to create your client proxy classes, as per this answer: Bypass invalid SSL certificate errors when calling web services in .Net

...
ServicePointManager.ServerCertificateValidationCallback = MyCertHandler;
...

static bool MyCertHandler(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors error)
{
   // Ignore errors
   return true;
}
Community
  • 1
  • 1
BunkerMentality
  • 1,327
  • 16
  • 21
  • 1
    The question is for when adding a web reference in Visual Studio, not calling the actual webservice. – Jesper Dec 05 '18 at 14:40