[Mono-list] Https WebRequest

Michał Ziemski rook at roo.k.pl
Wed Apr 30 02:20:29 EDT 2008


Hi!

You probably need to implement own ICertificatePolicy
        private class CerPol : System.Net.ICertificatePolicy
        {
            public bool CheckValidationResult(System.Net.ServicePoint 
srvPoint, System.Security.Cryptography.X509Certificates.X509Certificate 
certificate, System.Net.WebRequest request, int certificateProblem)
            {
                return true;
            }
        }
        System.Net.ServicePointManager.CertificatePolicy = new CerPol();

Cheers!
Michał Ziemski
Abe Gillespie pisze:
> 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
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>   



More information about the Mono-list mailing list