[Mono-devel-list] Problems with HttpWebRequest, WebProxy, and Mono.Security.Protocol.Tls.SslClientStream

Adam Israel adam at battleaxe.net
Sun Aug 15 23:48:47 EDT 2004


Hi folks,

I'm converting some of my projects to Mono and in the process I'm
working through the idiosyncrocies that I run into.  This latest one has
me a little stumped.

Environment:
Debian Unstable
Mono CVS
TinyProxy

Essentially, I've narrowed this down to the following:  make a GET
request to a remove server over https, through a proxy.

Attached is a test app that will demonstrate the problem.

>From what I can tell, it enters
Mono.Security.Protocol.Tls.SslClientStream, inside NegotiateProtocol(),
calls this.protocol.SendRecord(HandshakeType.ClientHello), and then
hangs trying to read the response.

Now, if I look at /var/log/tinyproxy.log, I see this:

CONNECT   Aug 15 22:28:29 [25232]: Connect (file descriptor 7):
localhost [127.0.0.1]
CONNECT   Aug 15 22:28:29 [25232]: Request (file descriptor 7): 

So it looks like it's attempting to talk to the proxy, but they're not
understanding each other.

A successful request through the proxy (using Firefox), looks like this:
CONNECT   Aug 15 22:42:47 [11094]: Connect (file descriptor 7):
localhost [127.0.0.1]
CONNECT   Aug 15 22:42:47 [11094]: Request (file descriptor 7): CONNECT
banking.53.com:443 HTTP/1.1
INFO      Aug 15 22:42:47 [11094]: No proxy for banking.53.com
CONNECT   Aug 15 22:42:50 [11094]: Established connection to host
"banking.53.com" using file descriptor 8.
INFO      Aug 15 22:42:50 [11094]: Not sending client headers to remote
machine
CONNECT   Aug 15 22:42:50 [11095]: Connect (file descriptor 7):
localhost [127.0.0.1]
CONNECT   Aug 15 22:42:50 [11095]: Request (file descriptor 7): CONNECT
banking.53.com:443 HTTP/1.1
INFO      Aug 15 22:42:50 [11095]: No proxy for banking.53.com
CONNECT   Aug 15 22:42:50 [11095]: Established connection to host
"banking.53.com" using file descriptor 8.
INFO      Aug 15 22:42:50 [11095]: Not sending client headers to remote
machine


As far as I know, the code I've attached should work, but I've run into
other minor gotchas with dealing with Ssl and Mono (particularly the bit
about accepting certificates).  I might just be missing something
vitally important, or maybe I've run into another bug in which case I
can file a report.  I'm sort of hoping someone can do a quick sanity
check and make sure that what I'm doing is right and the behavior I'm
seeing isn't expected.

Thanks,
-- 
Adam Israel <adam at battleaxe.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test5.cs
Type: text/x-csharp
Size: 1149 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040815/346cedc6/attachment.bin 


More information about the Mono-devel-list mailing list