[Mono-devel-list] HTTPS Post

Jeff Tickle jeff at jefftickle.com
Fri Jun 17 12:20:35 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sorry, here's the exception:

System.Net.WebException: Not connected ---> System.IO.IOException: The
authentication or decryption has failed.
in <0x001e1>
Mono.Security.Protocol.Tls.SslClientStream:NegotiateHandshake ()
in (wrapper remoting-invoke-with-check)
Mono.Security.Protocol.Tls.SslClientStream:NegotiateHandshake ()
in <0x000bb> Mono.Security.Protocol.Tls.SslClientStream:BeginWrite
(System.Byte[] buffer, Int32 offset, Int32 count, System.AsyncCallback
callback, System.Object state)
in <0x0001b> Mono.Security.Protocol.Tls.SslClientStream:Write
(System.Byte[] buffer, Int32 offset, Int32 count)
in <0x00035> System.Net.WebConnection:Write (System.Byte[] buffer, Int32
offset, Int32 size)--- End of inner exception stack trace ---

in <0x0013b> System.Net.WebConnection:Write (System.Byte[] buffer, Int32
offset, Int32 size)
in <0x00116> System.Net.WebConnectionStream:WriteRequest ()
in (wrapper remoting-invoke-with-check)
System.Net.WebConnectionStream:WriteRequest ()
in <0x00147> System.Net.WebConnectionStream:Close ()
in <0x000a6> Test:Main (System.String[] args)

Also, this is the 1.1.7 packaged with Ubuntu.  Last night, I installed
the binary package of 1.1.8 on my Debian server, and the exception is
much more concise, perhaps less-helpful:

System.Net.WebException: Error writing request.
in <0x0020d> System.Net.WebConnectionStream:WriteRequest ()
in (wrapper remoting-invoke-with-check)
System.Net.WebConnectionStream:WriteRequest ()
in <0x00147> System.Net.WebConnectionStream:Close ()
in <0x000a6> Test:Main (System.String[] args)

- -Jeff

Martin Hinks wrote:


>>>> What is the exact exception thrown - and where does the stack trace
>>>> say it originated - it does indeed sound like a certmgr thing, but
>>>> more information would help.
>>>>
>>>> Martin
>>>>
>>>> On 6/17/05, Jeff Tickle <jeff at jefftickle.com> wrote:
>>>>
>>>> Not sure if it's a bug or just my lack of understanding of
security, but
>>>> the fact is, this code works without fail in .NET, but not in Mono:
>>>>
>>>> using System;
>>>> using System.IO;
>>>> using System.Net;
>>>>
>>>> public class Test {
>>>>    public static void Main(string[] args)
>>>>    {
>>>>        try {
>>>>            WebRequest request =
>>>> WebRequest.Create("https://api.safepages.com/process.pl");
>>>>            request.Method = "POST";
>>>>            request.ContentType = "application/x-www-form-urlencoded";
>>>>            byte[] bytes =
>>>> System.Text.Encoding.UTF8.GetBytes("action=dialup_add&mode=test");
>>>>            request.ContentLength = bytes.Length;
>>>>            Stream s = request.GetRequestStream();
>>>>            s.Write(bytes,0,bytes.Length);
>>>>            s.Close();
>>>>            Console.WriteLine(new
>>>> StreamReader(request.GetResponse().GetResponseStream()).ReadToEnd());
>>>>        } catch (WebException e) {
>>>>            Console.WriteLine(e);
>>>>        }
>>>>    }
>>>> }
>>>>
>>>> It should return an error saying that the login was invalid.
Instead it
>>>> throws an exception, and the stack trace suggests it has to do with a
>>>> failure to agree on security.
>>>>
>>>> I did read a bit on certmgr.  I tried importing the certificate of this
>>>> particular site, but it wouldn't go anywhere but the AddressBook and
>>>> didn't seem to make a difference.
>>>>
>>>> Thanks for any help!
>>>>
>>>> -Jeff
>>>>


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCstuRL5ulKJitYLoRAmQ5AKCrTEehTyvMq1Gm+Xsr1gmibvYoNQCffyZU
dGGzo+S0jCFi/6gn1pUZGb8=
=k+CK
-----END PGP SIGNATURE-----



More information about the Mono-devel-list mailing list