Reputation:
I currently build a simple SOAP API in C#.
More specifically I just use the sample of the Visual Studio Project when it creates a WCF App, this is why I do not provide any code as it is the standard code.
How can I make the requests to require SSL Protocol when the clients make any Requests?
I have used this documentation to make the API , getting-started-tutorial.
Upvotes: 0
Views: 230
Reputation: 11
The simplest way to achieve a secure connection is to put HTTPS instead of HTTP:
Uri address = new Uri("https://example.com");
You can find more details here: https://learn.microsoft.com/en-us/dotnet/framework/network-programming/using-secure-sockets-layer
If the URI begins with "https:", SSL is used; if the URI begins with "http:", an unencrypted connection is used.
WCF service as any other web resource is usually managed and hosted by the webserver. So, your task will be divided into two parts:
Better explained in this article: How to: Configure an IIS-hosted WCF service with SSL
Upvotes: 1