Service Bus for Windows Server Certificate cannot be verified

Using Service Bus for Windows Server

I get the following exception.

Message = X.509 certificate CN = *********** is not in the trusted people store. Failed to create X.509 CN certificate = ********. The certificate used has a trust chain that cannot be verified. Replace the certificate or change certificateValidationMode. The signature of the certificate cannot be verified.

I am trying to connect to the service bus on another computer from my Dev Box

Here is the code from the console application that I am using.

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate); ServicePointManager.CheckCertificateRevocationList = false; NamespaceManager namespaceManager = NamespaceManager.Create(); MessagingFactory messagingFactory = MessagingFactory.Create(); if (namespaceManager.QueueExists(QueueName)) { namespaceManager.DeleteQueue(QueueName); } namespaceManager.CreateQueue(QueueName); string QueueName = "ServiceBusQueueSample"; QueueClient myQueueClient = messagingFactory.CreateQueueClient(QueueName); BrokeredMessage sendMessage = new BrokeredMessage("Hello World !"); myQueueClient.Send(sendMessage); <---- !!!Exception!!! 

I exported certificates from the Service Bus server. Using: Get-SBAutoGeneratedCA AutoGeneratedCA.cer AutoGeneratedCA.cr1

Then I imported both files using the default settings into my dev.

I have added the following elements to my app.config.

  <system.serviceModel> <behaviors> <endpointBehaviors> <behavior > <clientCredentials> <serviceCertificate> <authentication certificateValidationMode="None" revocationMode="NoCheck" /> </serviceCertificate> </clientCredentials> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel> <microsoft.identityModel> <service> <certificateValidation certificateValidationMode="None" /> </service> </microsoft.identityModel> 

I can successfully authenticate and check if the queue exists and delete it, and then create a new one.

When searching for a solution, I found this. Suggesting that there was a problem with the revocation server, since I also imported the list of Revocatin certificate, I don’t see that this is my problem.

I also found this : What is related to this blog post : I have unsuccessfully followed up on the proposal.

This blog post :
Suggest that setting revocationMode = "NoCheck" does not affect this problem, and its solution was to fake a certificate revocation list

This blog post : Suggest adding endpoint behavior to disable certValidationMode, I did, and I'm still getting an error.

Note. When I place the service bus on my Dev machine, everything works.

Any suggestion I haven't tried?

+4
source share
1 answer

It turns out that I did not import the certificates correctly ...

I followed these instructions and it worked.

http://msdn.microsoft.com/en-us/library/windowsazure/jj192993(v=azure.10).aspx

I think that right clicking and installing the certificate put them in the wrong place.

+4
source

Source: https://habr.com/ru/post/1441861/


All Articles