|
-
Jun 10th, 2010, 06:36 AM
#1
Thread Starter
Hyperactive Member
WCF, can I just confirm something
Hi All,
I have the below code for my service, could I just confirm my own understanding that the client will connect establish a secure connection using the certificate specified in the below code. It will then pass a username and password to authenticate itself. I only ask as, well I only ask as I've been trying so many differet binding combinations that I've got myself in a complete tiswas.
Cheers
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tcpbinding As New NetTcpBinding()
tcpbinding.Security.Mode = SecurityMode.Message
' tcpbinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Certificate
tcpbinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName
Dim tcpuri As New Uri("net.tcp://kalel:5051/mns")
Dim host As New ServiceHost(GetType(MagicNumbers), tcpuri)
host.Credentials.ServiceCertificate.SetCertificate(System.Security.Cryptography.X509Certificates.StoreLocation.CurrentUser, System.Security.Cryptography.X509Certificates.StoreName.Root, System.Security.Cryptography.X509Certificates.X509FindType.FindByThumbprint, "e0 0f 82 a6 c4 06 2d 2e 7c 55 80 0f 51 a6 c5 e9 f1 15 93 9f")
host.Credentials.IssuedTokenAuthentication.RevocationMode = System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck
Dim smb As New Description.ServiceMetadataBehavior
host.Description.Behaviors.Add(smb)
host.AddServiceEndpoint(GetType(MagicNumbers), tcpbinding, "net.tcp://kalel:5051/mns")
host.AddServiceEndpoint(GetType(Description.IMetadataExchange), System.ServiceModel.Description.MetadataExchangeBindings.CreateMexTcpBinding(), "mex")
host.Open()
MessageBox.Show("Service Started!")
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|