Page 1 of 1

Error when consuming a secure WCF service

Posted: Mon Mar 11, 2019 10:27 pm
by fangeles

I have configured the WCF to be accessed via HTTPS, but I can't properly consume it.

Here's my setup.

1. Hosted the WCF service to IIS, port 443 (https) and created a self-signed certificate, authentication is Anonymous.
2. Re-added the WCF service by accessing the https url
like: https://oursite/web/service.svc
When adding, Visual Studio confirmed if I want to access the site, I clicked yes.

3. Running the website
3A. From as local file, I've got this error: 403 (Forbidden)
3B. Hosted the html and javascript files to Linux-Apache, https. Therefore, I've got this error:
Mixed Content: The page at 'https://myhostingserver/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://sprongfield.local/WebModels/Service.svc'. This request has been blocked; the content must be served over HTTPS.

Hopping for your feedback soon.



Re: Error when consuming a secure WCF service

Posted: Tue Mar 12, 2019 12:43 am
by fangeles

I've reconstructed the Website in IIS and it goes pretty well. EXCEPT, the user needs to allow to proceed to the untrusted certificate first.

I got this error:
Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID

I've found an article on CodeProject on how to suppress HTTPS Errors: ... Http-bindi

How to implement it in CSHTML5 since the code is for ASP.NET?

Thank you.