Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

UnauthorizedAccessException (Microsoft.ServiceBus)

$
0
0

Hello,

I have been tinkering with the idea of using servicebus for windows server, and have a few articles linked to getting started, but can't seem to actually attach to queue.  Here is what I have done:

1. Set up two development machines with Service Bus 1.0 for Windows Server

2. Only one instance is running SQL Server (machine SBA, with DB SVCBUS).

3. Used all of the defaults for 'Create a New Farm'

---------------

HttpsPort                     : 9355
TcpPort                       : 9354
MessageBrokerPort             : 9356
FarmCertificate               : Thumbprint:
                                IsGenerated: True
EncryptionCertificate        
Hosts                         : {Name: sba.domain.net, Configuration
                                State: HostConfigurationCompleted, Name:
                                sbb.domain.net, Configuration
                                State: HostConfigurationCompleted}

---------------

Now - Following a combination of tutorials, I have copied/pasted my way with the following -

        static string servername = sba";
        static int httpPort = 9355;
        static int tcpPort = 9354;
        static string sbNamespace = "ServiceBusDefaultNamespace";

Uri sbmgmt = new Uri(string.Format("sb://{0}:{1}/{2}", servername, httpPort, sbNamespace));
Uri sbaddr = new Uri(string.Format("sb://{0}:{1}/{2}", servername, tcpPort, sbNamespace)); 

NamespaceManagerSettings nsmgrs = new NamespaceManagerSettings();
nsmgrs.TokenProvider = TokenProvider.CreateWindowsTokenProvider(new List<Uri>() { sbmgmt }, CredentialCache.DefaultNetworkCredentials );
NamespaceManager n = new NamespaceManager(sbmgmt, nsmgrs);

MessagingFactorySettings mfs = new MessagingFactorySettings();
mfs.TokenProvider = TokenProvider.CreateWindowsTokenProvider(new List<Uri>() { sbmgmt }, CredentialCache.DefaultNetworkCredentials);

MessagingFactory m = MessagingFactory.Create(sbaddr, mfs);

if (!n.QueueExists("Builds"))
    System.Console.WriteLine("Queue: <Builds> does not exist. . . ");

And the result!  --- :\

The token provider was unable to provide a security token while accessing 'https://sba:9355/ServiceBusDefaultNamespace/$STS/Windows/'. Token provider returned message: 'The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.'.

Forgive me if any bad naming conventions exist!  I am just trying to test this thing out and didn't really care about cleanliness of code.  I just need to figure out why I can't authenticate with the service bus.  I should also note that visiting my test machine in a web-browser does in fact show a couple nodes in the list.

https://sba:9355/ServiceBusDefaultNamespace = 

<feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Publicly Listed Services</title><subtitle type="text">This is the list of publicly-listed services currently available.</subtitle><id>uuid:asdasdasdasdasd;id=1</id><updated>2012-11-14T19:42:06Z</updated><generator>Service Bus 1.0</generator></feed>

Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>