I have a C # application for self-hosting Owin, which provides web API services compared to 127.0.0.1/10555 (it only listens on localhost, no external connections).
These web API services are called using Ajax from an AngularJS application. Aside: the reason for the Owin application is that it requires some interaction with the hardware, which is not possible in the browser. In addition, the AngularJS application is intended for internal use, so I control the browsers used.
The above works very well over HTTP, but for an Angular JS application, you must use SSL, which does not work if the Owin application also does not use SSL (otherwise you will get "mixed content" errors).
I bought an official certificate for an AngularJS application, and I use self-signed certificates for Owin localhost files.
The problem is that I get "NET :: ERR_CERT_AUTHORITY_INVALID" (when testing from Chrome) and "net :: ERR_INSECURE_RESPONSE" from an AngularJS application when talking to Owin Web API.
Here is what I did with wide strokes:
I used the CentOS field to create a certificate for localhost and exported it in pkcs12 / pfx format. I also generated a CA certificate and exported it in the same way.
Using MMC, I imported the localhost certificate to a Windows 7 machine running Angular and Owin applications into certificates (local computer)> personal> certificates.
I also imported a CA certificate on a Windows 7 machine into certificates (local computer)> Trusted Root Certification Auhorities> Certificates
Looking at the localhost certificate, he says "Issued to: localhost", Issued by: "ca.acme.com", "You have a private key that matches this certificate" (along the certification path) "This certificate is Ok"
CA cert says: "Issued: ca.acme.com", issued: "ca.acme.com", "You have a private key that matches this certificate" (along the certification path) "This certificate is Ok"
netsh http show sslcert IP:port : 127.0.0.1:5555 Certificate Hash : 1234555555555555555555511155555555555555 Application ID : {1234a123-1234-1234-1234-123412341234} Certificate Store Name : (null) Verify Client Certificate Revocation : Enabled Verify Revocation Using Cached Client Certificate Only : Disabled Usage Check : Enabled Revocation Freshness Time : 0 URL Retrieval Timeout : 0 Ctl Identifier : (null) Ctl Store Name : (null) DS Mapper Usage : Disabled Negotiate Client Certificate : Disabled
What am I missing? How to force Chrome, etc. Trust SSL certificate for localhost?