[Mono-list] Https WebRequest

Abe Gillespie abe.gillespie at gmail.com
Tue Apr 29 23:11:52 EDT 2008


Sorry for replying to my own thread, but I've got some more info.  If  
I do simply:

HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://checkout.google.com 
");
WebResponse res = req.GetResponse();
using (Stream stream = res.GetResponseStream())
{
     int b = stream.ReadByte();
     Response.Write("Got " + (char)b + " from Google Checkout.");
}

I get the following:

Mono.Security.Protocol.Tls.TlsException: Invalid certificate received  
from server.
   at  
Mono 
.Security 
.Protocol 
.Tls.Handshake.Client.TlsServerCertificate.validateCertificates  
(Mono.Security.X509.X509CertificateCollection certificates) [0x00000]
   at  
Mono 
.Security 
.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 ()  
[0x00000]
   at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process ()  
[0x00000]
   at (wrapper remoting-invoke-with-check)  
Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()
   at  
Mono 
.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage  
(Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000]
   at  
Mono 
.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback  
(IAsyncResult asyncResult) [0x00000]

Thanks!
-Abe

On Apr 29, 2008, at 11:02 PM, Abe Gillespie wrote:

> Is the ability to send an SSL web request implemented?  I'm trying  
> to use the Google Checkout API http://code.google.com/p/google-checkout-dotnet-sample-code/ 
>  and am getting the following inner-most exception:
>
> System.Net.WebException: Error writing request.
>  at System.Net.WebConnectionStream.WriteRequest () [0x00000]
>  at System.Net.WebConnectionStream.Close () [0x00000]
>  at System.IO.Stream.Dispose () [0x00000]
>  at GCheckout.GCheckoutRequest.Send () [0x00000]
>
> The code I'm using looks like:
>
> CheckoutShoppingCartRequest req = checkoutButton.CreateRequest();
> req.AddItem("Cogswell Cogs", "Cog", 279, cnt);
> GCheckoutResponse resp = req.Send();
> Response.Redirect(resp.RedirectUrl, true);
>
> // The URL the above code hits is https://checkout.google.com/...
>
> If it's a bug, I'll be happy to file a report.  But don't know if  
> I'm missing something.  Oh, and the line you probably don't want to  
> read:  "It works on Windows."
>
> Thanks!
> -Abe



More information about the Mono-list mailing list