1: How to use Windows Authentication:
CREATE ENDPOINT Instinitiatorendpoint state = STARTED as TCP (Listener_port = 4022) for Service_broker (authentication = WINDOWS); Go is created between two instances, using Windows authentication, which is sufficient when two computers are in the same domain.2: Certificate-based method validationCertificates for inter-database communication are present in the master database, so our first step is to create the master key and certificate in the master database, and to back up the public key.Use master go--master keyCreate master key encryption by password= ' [email protected] #masterkey249 ';--certificateCreate certificate Broker_private_249_cer with subject= ' for 249 ', start_date= ' 11/11/2009 ', expiry_date= ' 11/11/ 2111 '; Backup certificate broker_private_249_cer to file= ' c:\cert\broker_public_249_cer.cer ';
The second step is to create the endpoint and certificate bindings ( the certificate that is bound here is the private key that you created )
CREATE ENDPOINT [Broker_249_endpoint] AUTHORIZATION [Sa]state=startedas TCP (Listener_port = 4022, listener_ip = All) for S Ervice_broker (message_forwarding = ENABLED, message_forward_size = ten, authentication = CERTIFICATE [Broker_private_249_cer], encryption = DISABLED) The third step is to create login and user Create login Broker_243_login with password= ' qsmc+12345 '; Create user Broker_243_user for login broker_243_login;Generating mapping relationshipsFourth step: Copy the public key backed up by the other party to its own server side, and bind create certificate broker_public_243_cerauthorization broker_243_user from file= ' C : \cert\broker_public_243_cer.cer '; bind the user you just created, and create a certificate (authorization) Step fifth: Grant the right to create a user connection endpoint on endpoint:: Broker_249_endpoint to Broker_243_login;one thing to keep in mind: A DB instance can have only one Service Broker endpoint: endpoint, when we build an already endpoint, we need to access the endpoints from other databases, and we can do this only from the scattered. This completes the creation. Well, it's kind of a sense of accomplishment.
SQL Server broker Remote Endpoint certificate authentication