Could not establish secure channel for ssl/tls authority - wcf

WCF service installed on two servers and accessing that service through load balancer. We have domain validation certificate which is installed on load balancer. WCF client is giving error "Could not establish secure channel for ssl/tls authority" while adding service reference but SOAPUI is able to access service.
I am not sure what is causing this issue. Any help will be appreciated.
Thanks in advance.

The root cause is the account running the WCF client application failed to access the private key of the client certificate.
The reason we should establish the secure channel for SSL authority is that the communication between the server-side and the client-side works over https, therefore, these two sides should exchange the public key of the certificate. After that, the private key of the client certificate will be used to unencrypt the https message so that the https traffic would work properly. Likewise, the server account also should have access to the private key of the service certificate.
Please refer to the below steps to add the Everyone account to the management group of the private key of the client certificate so that the client account can access the private key properly.
Feel free to let me know if there is anything I can help with.

Related

The HTTP request was forbidden with client authentication scheme 'Anonymous' net core

I'm having a .net core API and an EmailService as a connected service (WCF)
The EmailService is hosted on IIS (HTTPS); I'm trying to connect to the emailService with a Client Certificate. Everything is fine but i'm getting the
The HTTP request was forbidden with client authentication scheme 'Anonymous' error;
On the EmailService side:
The SSL Settings are on Require SSL (Require), the IIS Binding is on HTTPS
On the API side:
When i'm trying to access the emailservice by chrome browser, i'm getting a prompt for a client certificate, i'm picking the cert and everything works alright;
Any suggestions?
Thanks
I am not sure if you can call the service properly since WS-security is not supported in DotNet Core. Anyway, this error typically indicates that the client’s certificate cannot be recognized by the server-side when establishing the Https communication. Also, if your client communicates with the server over HTTP and the server requires SSL, this kind of error also occurred.
The Https secure communication between the client-side and the server-side can not be established properly. As you know, the https secure communication requires the procedure of exchanging each other’s public key of the certificate. Therefore, the server-side and the client-side should establish mutual trust. In other words, the server’s certificate must be trusted by the client and the client’s certificate must be trusted by the server. The specific operation is to install the certificate in the local Trusted Root Certification Authorities.
Please refer to the below link.
https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/transport-security-with-certificate-authentication
Besides, the client-side should have access to the private key of the certificate provided by the client so that the https secure communication is valid. The specific operation is to add the current user to the private key management group of the certificate.
Feel free to let me know if there is anything I can help with.

How secure is the https connection if the client not passes certificate

We have a web server running on linux machine where we configured 'SSLVerifyClient' as 'require' in ssl.conf file.
Does this needs client who is utilizing the service from web browser(like firefox or chrome) needs a certificate.
If yes, then it is not possible to distribute client certificate to every user as there can be some thousands of users, how to overcome this problem.
If no, then how the data passed over network is secure? I know that certificate helps in encrypting data so that no one who don't have certificate can read data.
Please help me in clarifying my doubts
If you don't use client certificate, the https connection is still safe:
Only the client and the server can read/write the content
The identity of the server is assured by a certificate authority
Client certificate only give you client authentication in the beginning of the connection. To encrypt the data, the public key of the server is used in the beginning (See public key encryption).
If you identify the client with cookies set after login/password submit, it is still safe: you have identify the client.
When SSLVerifyClient is set to require, the client MUST pass a client certificate. You would generate these via OpenSSL, and sign them with a certificate authority that you install via SSLCACertificateFile.
How you distribute those certificates is an issue you'll have to solve yourself.

When we create SSL enabled Service, do we have to hand out certificates to each client?

One of my teammate just enabled SSL on one of the service that we are using and I had to install a Certificate that he gave me to each of the client machines who intend to consume that service. Now, I am not very well-versed when it comes to SSL security and that raised a question in my mind that
WHENEVER we create a SSl enabled service, do we have to hand out certificate to all the clients
Is there any kind of configuration using which we create an SSL enabled service without having to hand out certificate to all the clients?
IF it is possible then how secured that service be than the service which requires each client to install certificate on the machine?
Also, is there any easy to understand article on WCF SSL security?
Que : WHENEVER we create a SSl enabled service, do we have to hand out certificate to all the clients
Ans : No. For SSL enabled service one do not need to handout certificates to clients.
SSL certificate on server (in this case service) side gives confidence to clients that they are talking to legitimate server.
Clients needs certificates only in case of when service needs its clients to prove their identity using client certificate. With client certificate server (service) gets confidence that its sending data to legitimate clients.
Que : Is there any kind of configuration using which we create an SSL enabled service without having to hand out certificate to all the clients?
Ans : Certainly there is way with which you can make service enabled without requiring client certificate. Check SSL Settings option for website where service is hosted.
Que: IF it is possible then how secured that service be than the service which requires each client to install certificate on the machine?
Ans : Obliviously using SSL certificate doesn't stop any clients from consuming it. Any client who knows service endpoint can consume it. Client certificate is one way to authenticate clients. Only those clients who has valid client certificate will be able to consume service.
Que: Also, is there any easy to understand article on WCF SSL security?
Ans : Check out this link : https://msdn.microsoft.com/en-us/library/ff650862.aspx Its WCF regarding security as whole and not just SSL security.

BizTalk WCF-WebHttp Adapter SSL Certificate Props

What is the difference between Client Cert and Service Cert props in the security tab of WCF-BasicHttp, WCF-WebHttp adatpers based recv and send ports and how they are used by BizTalk for SSL authentication?
The documentations are not that specific.
How to Configure a WCF-WSHttp Send Port
Seems reasonably clear in that article to me
The Client Certificate is the one you hold the private key for and is used for signing your messages so the recipient can verify who you are.
certificate for authenticating this send port to services
The Service Certificate is the public key of the service you are connecting too. This way it can verify that you are connecting to who you think you are connecting too.
certificate for authenticating the service to which this send port sends messages
This is not required "The default is an empty string." however it is a security feature that prevents someone successfully being able to spoof the web service and intercepting your payload if they manage to poison the DNS entry.

WCF: Client-side Mutual Certificate Authentication Problem (Could not establish secure channel for SSL/TLS with authority)

I've done thorough research on my problem and have read many other posts/blogs but their solutions didn't solve mine. I was hoping someone could help.
I have a very simple WCF service that uses WsHttpBinding Transport Security with Mutual Certificate Authentication. The server certificate is self-signed certificate and I have confirmed I have the certificate in the trusted store on the client machine. The server has the client certificate (also self-signed) in the trusted certificate store and I have already verified that I can mutually-authenticate to the service fine using SOAPUI client.
However, I'm not able to do so using the WCF client I created. On the WCF client, I've set the client certificate by calling the channel factory's Credentials.ClientCertificate.SetCertificate(...) method and I've also added
ServicePointManager.ServerCertificateValidationCallback +=
( sender,
certificate,
chain,
sslPolicyErrors ) => true;
to bypass all possible server certificate problems but I always get: Could not establish secure channel for SSL/TLS with authority server.com.
Can someone please suggest to me what might be the problem and/or what I should do to get this working? Any help is appreciated.
Thanks.
try this to see if this is only a problem with the certificate trust chain:
http://webservices20.blogspot.com/2008/12/wcf-gotcha-disabling-ssl-validation.html