Is it possible to go through a basic authentication proxy using WsHttpBinding?

I had a problem getting an authentication proxy using Basic authentication with WSHttpBinding.

Similar code for BasicHttpBinding works. I assume that my problem is that I cannot set the security mode of WSHttpBinding to TransportCredentialOnly ..

I cannot use BasicHttpBinding due to MTOM dependency.

        binding.ProxyAddress = new Uri("http://192.168.20.231:8080");
        binding.BypassProxyOnLocal = true;
        binding.UseDefaultWebProxy = false;

        WSHttpSecurity security = binding.Security;

        //security.Mode = SecurityMode.TransportCredentialOnly; //This option only exist for BasichHttpBinding
        security.Mode = SecurityMode.Transport; // Not sure what to set here

        //security.Mode = SecurityMode.TransportWithMessageCredential;
        security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic;
        security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;


        var client = new SyncWcfMTOMServiceClient(binding, new EndpointAddress("http://server/service.svc"));

        client.ClientCredentials.UserName.UserName = "user";
        client.ClientCredentials.UserName.Password = "pass";
        bool running = client.IsServiceRunning();
0
source share
2 answers

After some research, I found the answer to this question. (I'm not quite happy with the solution and hope there is another way to solve this problem)

wsHttpBinding , - ! basicHttpBinding

, , ( -).

SSL- , . SSL .

?

0

ist , . Security.Mode = Transport , https (ssl), URL

security.Mode = SecurityMode.Transport; // Not sure what to set here
0

All Articles