Using SSL with a .net remote endpoint without IIS - c#

I have setup a vanilla .net remote endpoint. It is behind a load balancer that handles SSL traffic so all the server side endpoint sees is plain old TCP traffic. The client configuration needs to be set up to connect to the load balancer over SSL.
The whole point of this exercise is to remove IIS from the technology stack.
What should the client configuration be? or is this even possible?

Related

Handle a HTTPS WebSocket handshake in C#

I have a local c# server running and listening on localhost and a browser connecting to a cloud service running a JavaScript HTML5 implementation of websockets. Standard ws://
This works great over HTTP:// and I can read the header and use it, but I need it to run in HTTPS:// I understand that I have to change to wss:// and this does connect to my server but the header is garbled/encrypted.
I have looked into SslStream but drawn a blank.
How do I handle this WebSocket Secure header in C#?
This question was answered in the comments:
If your app is behind a Proxy load balancer, it would normally manage the SSL for you (accessing your app without encryption).
If you need to manage SSL, complete the SSL handshake first (usually right after you accept the connection) and than parse protocol specific data (HTTP, Websockets, SMTP etc').

Connect to Web Server using HTTPS from .NET Client

I'm totally new to SSL. I have .NET client that connect to Web Server (SOAP-based web Services) using HTTPS. Do I need to do anything extra at the .NET client app? Current, the server end-point URL that I use is already HTTPS, and it seems to work fine. However, when comparing to browser, a browser knows when it's HTTPS connection (the pad lock at address bar). So, how do I ensure that my .NET client is connect via HTTPS connection? Thanks in advance.

httplistener and http connect method

I am using the HTTP Proxy setting on my ipad to redirect traffic to my .net httplistener.
If i send http traffic using the ipad proxy sends the traffic to my httplistener, and
my code does its thing. If i send https traffic using the ipad and its http proxy I see the packets show up at my machine (sniff using wireshark) on port 8443, but my listener doesn't get kicked off. I have the prefixes and certificates correct. I proved this out by instructing a browser to go directly to my machine w/o the http proxy using port 8443.
I noticed from my sniffs of the https connection attempt that the HTTP CONNECT method
is contained in the packet. Its probably trying to tunnel the SSL traffic. Does http.sys or httpListener recognize/handle the CONNECT method ? I am curious why my httplistener isn't firing off ??
thoughts on how I can further troubleshoot this ?
It's not stated in your question, so have you actually setup your HttpListener to support SSL with a site certificate as documented in this question?
How do I add SSL to a .net application that uses httplistener - it will *not* be running on IIS

How to allow remote connections to my .net application?

I'm writing an application with both a desktop and a mobile app component. The desktop app is being written in c#, and I'd like to be able to open it up to act as a server for the mobile app (similar to what AirVideo does). How can I accomplish this without requiring the user to configure their firewall and/or router?
Ideally, I want to self host a restful wcf service in the desktop app. I've tried this already, but the automatic configuration of the firewall doesn't allow remote connections to the wcf service, since it appears to be hosted by the system process. Is there a workaround for this behavior?
Edit: I've solved the router problem as best I can through the use of the NATUPnP COM library (http://pietschsoft.com/post/2009/02/05/NET-Framework-Communicate-through-NAT-Router-via-UPnP.aspx). I still need to know how to allow remote connections through the firewall to a self-hosted WCF service without any manual configuration of the firewall (I'm okay with the user prompt to allow connections once the app is launched).
Set a specific port in your router that is designated to route to your server address,
So if your router real ip is a.b.c.d, you should set up that all communication to a.b.c.d:port# is being routed to your server local address. (a.b.c.d:port# --> serverIP)
The settings for this can be achieved from your router configuration.
In a situation where you cannot tinker with the router setting/firewall settings:
This means you cannot use ports to listen to incoming connections and can only use outgoing connections. to overcome that you will have to use a 3rd server with real IP-Address which will function as a listener for both sides. Typical scenario can be described as follows:
Client Side - A (Desktop)
Client Side - B (Smartphone)
Server Side - S (Communications Server)
S --> Open port for listening to incoming connections.
A --> Connect to S every x seconds to check if requests to do something are waiting.
B --> Connect to S. (issues a waiting request for A)
That way S is served as a proxy to glue both sides' communications.

Tunneling through a proxy

My Intranet users are accessing the Internet through a proxy on the network. I need to monitor and filter certain requests to that proxy on a few machines. In essence, I need to proxy the proxy on the local machine.
How do I insert a local application as a relay between the local system and the Intranet proxy?
I would have to change the local proxy settings to an endpoint on the local machine, which in turn should relay HTTP requests to the outside proxy. But, I have no experience with writing proxies. Is this even possible?
Edit: The term I was looking for is tunneling, not proxying through a proxy. It is possible and I managed it with a TCP pipe.
Why not use an existing proxy server? This has all required capabilities and you don't have to worry about stability and performance.
I wrote a custom TCP tunnel that forwards requests to the Intranet proxy and pointed the browser proxy to the local machine.

Categories