Hello:
I'm developing a proxy server in VS 2005 C# and i got a problem with the
HTTPS tunneling protocol.
The secuence I follow is something like that:
1. I read the client request with a new Socket object.
2. If the request is like "CONNECT server:443 HTTP..." go on, else jump to
the HTTP proxy that works good.
3. I connect to the server requested by the client with a new SslStream
object.
4. If the connection is established without errors I send a "HTTP/1.0 200
Connection established..." to the client with the Socket object created on
step 1.
5. I read the next request from the client with the Socket created on step
1, and I receive an array of binary bytes (not text secuence).
6. I send this arrays to the server with the SslStream object created on
step 3.
7. I receive a text string from the server in HTM format with a "Bad
request" message or similar, depending on the server that I connect.
In the theory, after I send the "Connect established" to the client I must
send the data received from the client to the server and viceversa, until the
conection is broken.
Take note of that. If after the "Connection established" I send a "GET /..."
string to the server, it returns the web page that I'm asking for.
Is possible that I must convert the Socket object created on step 1 to a
SslStream?
Thanks for your comments and answers, and sorry for my bad English!
Un saludo!
--
Juan Segura
www.sd-a.com
ju**@sd-a.com